This is our GIT extensions tutorial for beginners. Here’s what you are going to learn:
GIT Extensions is a distributed version control system enabling a user to robustly manage a collection of source files and the changes made in them. The changes made are shown in the History of changes. Users can make changes by accessing a Central repository called remote repository and committing the changes to it. It implements classic GIT by using GUI (Graphical user interface), basically driven by a set of dedicated commands, hence maintains the version control system intuitively. So, let us go through a glimpse of functionalities provided by GIT Extensions so that our version control system can be maintained.
There are many options to manage repository through GIT Extensions. It includes viewing the committed logs and changes made in comparison to the previous commit, cloning a repository, traversing through the file directory and filtering the committed logs by using custom search input, etc.
GIT Extensions can be downloaded from https://github.com/gitextensions/gitextensions/releases/tag/v2.48.05
SSH Keys should be loaded as a one-time activity. SSH keys can be generated while setting up the GIT Extensions.
The first thing is to check that Git Extensions is properly configured to use PuTTY, as well as all paths, are given correctly.
In the Remotes Tab just choose Generate or import key to start the key generator.
It will ask you to move around the mouse in order to generate more random keys. When the key gets generated, save the public and private key in a text file by clicking the Save Public key button.
Since now you are having a key pair, provide the public key to the Github account by copying the Key from the file which you just saved above at your desired location.
Then open your Github account and click on the profile image, followed by Account settings and going to the SSH Keys tab. Finally, paste the public key over there.
You can create a Github account at https://github.com/join?source=header
Now GitHub will get to know which public key it has to use to decrypt. Now you also need to provide the private key to GitExtensions to encrypt. You will find a Load SSH key button in the clone dialog where you can load the private key in PuTTY authentication.
Cloning a repository will create a local copy of the repository being cloned by this action.
From the Common Actions section at the left click ‘Open Repository’ link and give the directory address for opening a repository. Then click the ‘Open’ button as highlighted in the figure.
It opens the repository and all committed logs will be shown with an abstract message associated with them, committed user, and the time elapsed when the commit was done (Refer figure). Also, the details like Author, date are shown at the bottom in the commit section.
Initially click ‘File Tree’ tab. It will show the whole repository in the form of a file tree and intended files and directories can be viewed easily. This is the step-wise procedure to traverse a repository by a user.
By clicking the ‘Diff’ tab comparison can be made with respect to the previous commit as shown in the figure.
This action of committing and then pushing the given code to a remote repository is divided into two operations:
This process of committing involves various steps:
|This represents all existing files that were edited after the last commit|
|This represents files which are removed after the last commit|
|This represents new files which are added after the last commit|
Note: Clicking ‘Commit’ lets the files to be committed into the local repository and not into the remote repository.
‘Push’ action is used to move the files of local repository into remote repository. It needs to be ensured by the user that the code which was taken lastly from the remote repository is not modified before you perform push action. There is every possibility that a repository could have been modified when it has been pulled or cloned by another person. This generally happens in a multi-user environment where a lot of branching and merging happens. Hence, it is necessary for a user to perform a Pull before opting for a Pushing action for the committed code.
As of now, the local repository and the remote repository are in sync, so the user now has to click the ‘Push’ button as shown in the figure so that all the locally committed changes can be pushed to the remote repository.
We hope that this tutorial helps you in getting familiarized with the use of Git using the tool Git Extensions.