- Version control/source control is the handle of tracking and managing changes to source code.
- It supports creating different versions of file collection. Each version captures a snapshot of the files at a certain point of time(ex: Creating commit in git)
- You can revert the collection of files using the snapshot. VCS allows you to switch between these versions.
- These versions are stored in a specific place, typically called a repository.
Types of VCS – Version control system :
(i) Local version control system : it’s a user end specific – it’s a local database of tracking of changes to files in the code. Copy of code stored in a particular developer, so relation to other developers.
(ii) Central version control system : it’s a central server where code is stored, everyone can connect and work with that code and make changes , so it helps to handle work by many developers.
- Centralised Version Control is a version control system using server/client model and server contains all the history(Commit history) of source code.
- In CVS, a client needs to get a local copy of the source from the server, do the changes and commit those changes to the central source on the server.
- Offline working not possible, have to connect with repository and you will get only the file what you want to edit, you do not get entire code
- Developer must and should connect to the repository to commit/save the changes on the code/file.
- If you are offline or server fails, then you won’t able to deal with Repository
- CVS is slower as every command needs to communicate with the server.
(iii) Distributed version control system : code stored at server with high availability and developers can copy that code to their local machine, when ever developers want ,they can send modified/developed code to server, and modified code can be updated to all developer local machines when they want to use the code.
Advantages of Distributed Version Control System – DVCS :
- Work offline
- Good backup/saving of code changes as versions(commits)
- Share the code among many developers
- Very much helpful for open source contribution for open source application/tools