Version Control System

Version Control System

Version Control System

It is a system that tracks the changes to any file that falls under it. Usually, this system contains development codes of different projects/applications that developers push as a part of each sprint or release.

It keeps the information and data of each time and person who have pushed the files to the system. In case of any issues in the application or project(let's say) the team can revert the changes of previously existing files.

There are two types of version control systems:-

  1. Centralized version control system -

    It is a central repository where the code lies. Developers check-out the code, modifies it and then check-in the code to the repository. Let's say there is a computer and a server, The server operates as the central location. When a developer changes the source code in his local machine, those changes get saved in the central server. The working copy is available in the local machine, but the versions are saved in the server.

  2. Distributed version control system -

    It is a remote repository where the code lies. It has both local and remote repositories. The complete versions of the projects, and all the changes can be pushed to the remote repository and can be fetched for any version of the code. Developers work independently and then merge the code whenever they want.

    Why do we choose DVCS over CVCS?

    1. DVCS has the biggest advantage in that it allows you to work offline and gives flexibility. You have the entire history of the code on your hard drive, so all the changes you will be making in your server or to your repository which doesn’t require an internet connection, but this is not the case with CVCS.

    2. DVCS is faster than CVCS because you don’t need to communicate with the remote server for each command. You do everything locally which gives you the benefit to work faster than CVCS.

    3. Working on branches is easy in DVCS. Every developer has an entire history of the code in DVCS, so developers can share their changes before merging all the ‘sets of changes to the remote server. In CVCS it’s difficult and time-consuming to work on branches because it requires communicating with the server directly.

GIT

Git - Logo Downloads

It is a free and open-source tool which follows distributed version control system. It is installed on the local computer to track the local file changes that are pushed to it. The advantages is as below:-

  • Every developer has an entire copy of the code on their local systems

  • Any changes made to the source code can be tracked by others.

  • There is regular communication between the developers.

GITHUB

Github Icon Vector Art, Icons, and Graphics for Free Download

It is a remote repository hosted on the internet that is an advanced version of Git. It also follows the DVCS methodology. It has both public and enterprise accounts. It makes it easy for developers to share code files and collaborate with fellow developers on open-source projects. GitHub also serves as a social networking site where developers can openly network, collaborate, and pitch their work.

Let's do some hands-on

Installing Git in a Linux server.

Let's set up our Github account.

Let's create a local git repository and push the files from local to remote repository i.e from Git to Github.

Now check the repository in Github.

The file should be now pushed to Github from local repository

Task:-

  1. Create a new repository on GitHub and clone it to your local machine

    Make some changes to a file in the repository and commit them to the repository using Git

  2. Push the changes back to the repository on GitHub

Thank you for reading my article.

Have a nice day.

WRITTEN BY Biswaraj Sahoo --AWS Community Builder | DevOps Engineer | Docker | Linux | Jenkins | AWS | Git | Terraform | Docker | kubernetes Empowering communities via open source and education. Connect with me over linktree: linktr.ee/biswaraj333