We use Git to save our code in snapshots that we can go back to whenever we want. And it lets people work together on code.

Git is an invaluable tool.

It allows us to work for months and years on a project, and yet get back to each individual change we made on the codebase.

It provides the ability to roll back and maintain separate different versions at the same time.

Each time we make a change or add a new feature or fix a bug we add a little explanation and we commit the changes.

Git is a distributed system. Many developers can collaborate on a single codebase by cloning a repository from a central location, work independently on some portion of code, and then committing the changes back to the central location where everybody updates.

Git makes it very easy for developers to collaborate on a codebase simultaneously and provides tools they can use to combine all the independent changes they make.

If you’re working solo, it’s handy because it allows you to roll back to previous versions of your code.

And also, it allows you to add notes when you do some changes, called commit messages, so in the future, you can say “ah that’s why I did that, 2 years ago”.

It also allows us to work with a team because each individual person can push commits to the codebase and Git takes care of making sure there are no conflicts with changes made by other people. And you can see who wrote a specific line of code, so you can ask for more information if needed.

There are various ways to use Git.

One is the command line. I’ll introduce this in this unit.

Another way is by using an application that makes things visual. We’ll see how to use GitHub Desktop in the next unit.

GitHub is a very popular service that hosts Git repositories, especially for Open Source software, but we can also mention BitBucket, GitLab and many others which are widely used by teams all over the world to host their code publicly and also privately.

Lessons this unit:

0: ▶︎ Introduction
1: Installing Git
2: Initialize a repository
3: Commit changes
4: Branches
5: Push and pull
6: Working with a remote
7: Solving conflicts
8: .gitignore