Git (git-scm.com) is a popular free and open source version control system that allows you to track changes to files both by you and by collaborators. See the Git Handbook for more information about this.
GitHub is a company that hosts Git repositories on their servers. They will host public repositories for free. Students and Instructors can apply to get private repostiotires as well.
As a student or teacher, you can get private repostitories for free through GitHub Education. Instructors should also check out GitHub Classroom that assists with collecting assignments through GitHub and special teacher training.