Important terms to know in Version Control System

Benefits , types and various operation performed in Git

Important terms to know in Version Control System
  • Working Directory : It's a workspace where developer's create/ modify files

  • Repository: It's a space where we store files and metadata

  • Commit: It's a process of sending files from working directory to the repository

  • Checkout: The process of sending files from repository to the working directory.


Basic process of how these terminology work in git :

Benefits of Version Control :

  1. We keep track of all the changes, so according to requirement of client, we can choose any version we desire

  2. With every version/ commit we can maintain metadata like :

    1. Commit message(usually user writes what changes they made)

    2. who did the change (user.name, user.email)

    3. when they did the change(timestamp)

  3. Developers can share the code to the peer developer in very easy way

  4. Multiple developers can work in a collaborative environment

  5. Parallel development

  6. Can provide access control like :

    1. Who can read

    2. Who can write


Types of Version Control :

  1. Centralised Version Control System (CVCS)

  2. De - Centralised / Distributed Version Control System (DVCS)

Centralised Version Control System:

  1. In CVCS, we have only one centralised repository and all the developer's should be connected to it.

  2. The total project code is stored at central repository.

  3. It is easy to set up and easy to use

  4. Ex. CVSC, SVN, Perforce, Clearcase, TFS etc.

Limitations :

  1. Constant network connections with remote repository is required for commit and checkout operations. If there is a network outrage then version control won't be available for the developers.

  2. There is only 1 centralised repository, so since all the project detail is stored at one central repository it become a bit risky.

  3. All commit and checkout operations will be performed by committing with the remote central repository server. (It means that these operations are not local operation)

  4. Performance is low

  5. If the number of developer increases or no of files increases then organizing the central repository becomes difficult.

De - Centralised / Distributed Version Control System (DVCS)

  1. All the limitations of CVCS is covered in DVCS

  2. All commits and checkout operation will be performed locally and hence the performance is more

  3. Even if there is a network outage, Version control will be available for developers because the repository is distributed

  4. In this distributed repository, every developer has their own copy of repo, so there is no question of single point of failure

  5. ex. Git, Mercurial, Fossil etc


Push and Pull operations :

Push : The process of sending files from our repository to others repository

Pull : The process of requesting files from others repository to our local repository


Difference between pull and push operations and Commit and checkout operations :

Push and Pull operationsCommit and checkout operations
1. These operations are performed between two repository1. These operations are performed between working directory and repository
2. These are remote operations2. These are local operations
3. These operation needs network for performing these operations3. Network is not required

Note:

  1. Commit and checkout operations are performing on local repository, but not on remote repository.

  2. Every Developer has their own repository in DVCS.

  3. Most of the time we use remote repository to share our code with peer developers.