According to the official Git website, Git is a “free and open source distributed version control system.” In simple terms, version control is a type of software that allows you to save snapshots of your project at different points in time using a feature called commits. Through the use of commits, you can “go back in time” and easily view or switch to previous versions of your project, or undo specific changes you’ve made along the way. This can save you time on larger projects since you don’t have to manually change your code to undo things.
Another feature that Git provides is branching. Branching allows you to create multiple versions of your project where you can work on different features for your project on each branch and merge them later on into the main branch (often called the master branch).
Your commits and branches are stored in a folder called a repository.
Git is primarily a command line tool, but there are applications available that allow you to perform many actions inside a GUI, such as GitHub Desktop and Sourcetree. You can learn more about GitHub Desktop here.
Git is often used with an online service like GitHub, BitBucket, or GitLab. These services allow you to back up your repository online and make it easier to collaborate with other developers who can download copies of your repository if you allow them to. That last feature makes these services popular for open source projects.
Here are some of the main concepts you’ll learn in this course:
- Initializing a repo
- Staging files
- Committing files
You can download exercises to go along with these tutorials on our Git exercises repository on GitHub. You don’t have to know how to use GitHub to use them. Just click the green Code button in the corner and click the Download ZIP option. Then unzip the folder and open it in your text editor.
Each module has a folder. Inside each module folder is a folder for each lesson. The lesson folders usually contain files already where you can put your code, although occassionally you will be asked to create files on your own.
NOTE: You can ignore the instructions included in the folders. The instructions are now listed directly in the lessons.
About Version Control from the Pro Git Book