Version Controls
Version Controls
Multiple repositories are present in distributed version control systems. Every user has
a functional copy and repository of their own. It won't be enough to just commit your
modifications for others to see them. This is due to the fact that committing the
changes will only affect your local repository; in order for the changes to appear in
the central repository, you must push them. In a similar vein,
In order to make your changes visible to others, four things must happen: ₡You
commit You push, They pull, They update. The most widely used distributed version
control systems are Git and Mercurial. These systems help us get around the single
point of failure issue. When you update, you do not receive others' changes unless you
have first pulled those changes into your repository.
Git
Git is a distributed system for version control which is used for both version control
and collaboration with commands.
History of Git :
Previously, open source projects needed to be patched each time as if the new features
or updates were taken with the archive files or sent the patches personally to the head
of the open source project. Around the time of 1992-2002, this process was in use.
After this, in 2002, a new source called Bitkeeper had came up into lime light to work
on these issues like version controlling and also the adding features with new ideas
and so on. Later around in the 2005 to 2006, Bitkeeper started to charge the people for
the services they provide. Then the era of git had evolved. Git has many advantages
than Bitkeeper like easy to understand, same commands in any platform. also the
branching is also available in it.
Git Installation :
Here, to install we need to setup a few requirements as if having a Visual Studio Code.
VS Code is a great light-weight IDE to work with beginners in coding. We personally
preferred the VS Code in the process. Hopefully, to understand further, you must have
a bit of idea about the UI of VS Code.
Later, go to the git website : https://git-scm.com/downloads and install the git for
windows in the standalone version. Later, after the installation, it sets default setting
in environment variables in the system. If not, we need to set the edit environment
variable by ourselves in it. Here I got it by default.
After installation let us check the version using the command called git --version.
Git Setup :
After checking of the version, let us configure git to the personal account of github to
the existing git account on the system
To configure the name with the git and github account initially with the command :
To configure the name with the git and github account initially with the command :
To setup the repository, we need to work on the folder. Here we are taking a folder
called task1. Let us check the status of the folder.
Now let us create the repository using the command : git init -b main
Let us create a text document in it and add it to the repository with git add cc.txt
Now let us test the repository with the git status
Now we are changing the data in txt file and try to commit it.
After the committing, let me change the txt file and check the
Now let us check the with the differences called the git diff
Now let us commit the changes and stage them :
Here, the txt file is neatly staged and committed here. Previously we just committed
but not staged, now we committed and staged. So, we could not find the difference in
the txt file.