Version Control Systems
What is a Version Control System?
A version control system (VCS), tracks the history of changes as people and teams collaborate on projects together. As the project evolves, teams can run tests, fix bugs, and contribute new code with the confidence that any version can be recovered at any time. Developers can review project history to find out:
- Which changes were made
- Who made the changes
- When were the changes made
- Why were changes needed
A VCS allows multiple people to work on the same set of files in structured harmony. Messaging your teammates about which file you're changing and telling them to keep their fingers off is not the optimal workflow. Neither is storing .zip snapshots of your code on a shared online drive.
With a VCS, team members can work on any project file on their local version and merge their changes into a shared version. The latest version of a file or the whole project is always in a shared location managed by the VCS.
Saving a version of your project after making changes is an essential habit. But without a VCS, this becomes tedious and confusing very quickly: How much do we save? Only the changed files or the complete project?
How do we name these versions? If you're a very organized person, you might be able to stick to a coherent naming system.
How can we know exactly what files changed in these versions? It is problematic to expect humans to carefully document each change consistently.
A version control system acknowledges that there is only one project. Therefore, there's only one version on your disk that you're currently working on. All the past versions and variants of your project are available through the VCS.
Restoring Previous Versions
Being able to restore older versions of a file (or even the whole project) effectively means one thing: you can't mess up! If the changes you've made lately prove to be garbage, you can simply undo them in a few clicks. Knowing this should make you a lot more relaxed when working on essential bits of a project.
Understanding What Happened
Every time you save a new version of your project, your VCS requires you to briefly describe what was changed. Additionally (if it's a code/text file), you can see what exactly was changed in the file's content. This helps you understand how your project evolved between versions.
A distributed VCS like Git can also act as a backup; every team member has a complete version of the project on their disk, including its entire history. All you need to recover your entire project if your server fails is one copy of the git repository.
What is Distributed Version control System
A distributed version control system (DVCS) is a type of version control where the complete codebase — including its full version history — is mirrored on every developer's computer.
Which VCS do we use in practice? At Grey Software, we use Git, like the overwhelmingly vast majority of software development companies.