Git is a free and open source distributed version control system. It allows you to easily work on files locally, as well as coordinate the work on those files between multiple people. Your local copy of the code is a complete version control repository. You can commit your work locally, then sync your copy of the repository with the copy on a server. This provides a lot of flexibility in terms of working offline, and in a non-linear workflow with a team.
The basis of tracking changes in Git is commits. Making a commit essentially takes a snapshot of the state of all the files in the directory at that point in time and saves that as a version of your project. If a file has not changed, Git saves a pointer to the previous version of that file.
Git is the version control system, and GitHub is a hosting service for Git repositories. Other services like GitHub include GitLab and Bitbucket. They provide additional features that help manage the software development lifecycle (such as bug tracking, wiki space, commenting, and reviewing).
Check out these links to learn more: