A version control system (VCS for short) is a method to store source code and other iterative design materials (webpages, etc) for both collaboration and security. what sets a version control system apart from other systems (backups) is that:
This adds up to a system that permits operations on a file-based structure
Git is the made for purpose replacement of BitKeeper as source control for the Linux kernel. It was developed from the ground up to support the wide development from thousands of developers simultaneously.
Some quick technicals:
In the old days, most version controls used a single branch. This is equivalent to using one folder for all code done by every user. This does have drawbacks though which branching hopes to fix. To illustrate this, we will use the example of the development of a video game. A video game could be said to usually have the following components and more:
Core engine
Graphics
Networking
Taking the world of a single branch, each of these teams would make development changes directly to the codebase immediately. This many issues for a large scale project though such as:
The answer is branching. Each team member has their own branch, along with each team having their own as well. This solution is surprisingly elegant; assume the following scenario. We have a dev called Bob that is part of the Graphics team. Bob would have the following for his branches:
Take our friend Bob again. In the beginning of a dev day, Bob would first pull all changes from others in their group. To do this, they would execute the following commands:
git pull - Grabs all new changesets from the main repo
git merge Graphics-dev - Merges all changes from the group repo with the local repo
At this point they would go through all the dev processes, changing files and such. Then they need to commit the local changes to the repo:
git commit -a -m “commit message”
‘-a’ automatically commits all changed files
‘-m’ sets the message for when it’s committed to the repo
If any new files are added, then this needs to be run instead:
git add -A
Finally, after all the changes are made, Bob must merge this back into the group repo:
git checkout Graphics-dev - Moves the current repo ‘pointer’ to the Graphics-dev branch
git merge Bob-dev - Merges the changes in Bob-dev into Graphics-dev