Version Control with Git
The Real World
- You have a project that you are working on with a team of people.
- You need to keep track of changes to the project.
- You need to be able to work on the project at the same time as other people.
- So you naturally make various copies of the project and share them with your team
- Some through email, some through shared drives, some through USB sticks or CDs/floppies if you are old school.
Well, no.
There is a better way. It’s called version control, and Git is the most popular version control system.
The Problem
- You want to be able to conveniently keep track of changes to your project.
- You want to share your project with your team.
- You want to be able to asynchronously work on different parts of the project.
All those points can be solved with version control.
What’s git/version control?
- Version control is like a lab notebook for your project.
- After you’ve made changes to your project, you write down what you did in your lab notebook (we call it commit).
- You can easily go back to any point in time and see what the project looked like at that time, everything is stored in the notebook.
- You can also see who made what changes, and why they made them (commit message).
- Other people can also see your notebook and make changes to the project.
- GitHub/GitLab/BitBucket are like a place to store your lab notebook online, so that everyone can see it.
- Everyone can also make a copy of the notebook and work on it on their own computer (clone).
- But to share the results of their work, they need to put it back in the online notebook (push).
- If someone else has made changes to the online notebook, they can get those changes and put them in their own notebook (pull).
This high-level overview is a bit abstract, but it may help you understand the basic concepts of version control. There’s a lot more to it, but what’s cool is you don’t need to understand the whole thing to start using it.
There are many, many materials online that can help you understand version control and Git in more detail so we won’t go into more detail here.
Note
Tapyr already comes up with git set up.