Version control system
A version control system (also known as a VCS) is a tool that helps you manage changes to your project's files over time. It lets you track the history of your project, restore previous states, and collaborate with others.
There are two main types of version control systems: centralized and distributed. Most version control systems of the past were centralized: they had a single server that stored the repository and managed the history. This setup had some serious drawbacks. You had to be connected to the server to work on the project, and if the server went down, no one could work on the project.
In a distributed version control system (DVCS), every user has a full copy of the repository, including its history, on their local machine. Changes are made locally and then shared between repositories as a set of changes (or patches). This setup allows for several advantages:
- Work offline: Users can commit changes, review history, and perform other version control tasks without a network connection since they have a full copy of the repository.
- Enhanced collaboration: Developers can share changes with each other in various ways before integrating them into a "main" repository.
- Increased redundancy: Every copy of the repository is a full backup, which can improve disaster recovery.
Examples of DVCS include Git and Mercurial.