Version Control System tool plays a vital role in today’s modern Software development. Version control is a software that helps a group of software developers work together and manage the history of the work. It does not overwrite other’s changes, therefore you can keep track of every change, revert the file or a project to its previous state.
The version control tool helps you to recover the lost file very easily. If a mistake is made by anyone from the team, one can look back and compare the earlier version of the file and fix the mistake or any conflict.
Git is one of the most popular decentralized version control tools used by developers to coordinate the work amongst them. It was designed by Linus Torvalds ( the creator of Linux Kernel.) in the year 2005.
Git offers features like data assurance, workflows, create branches, revert to the previous stage, incredible speed, keep track of your code changes, view logs, and many more. It allows you to perform your work in offline mode and when ready, you need the internet connection to publish the changes and take the latest changes.
In this tutorial, we will explain to you how to install Git on a CentOS 8 server using yum and source code. Each installation has its own benefits, the choice is up to you.
For example, users who want to Perpetuate Git update will use the yum method and those who need features by a particular version of Git will use the source code method.
Important: You must have a CentOS 8 server installed and configured with a sudo user with root privileges. If you don’t have one, you can create a sudo account
Installing Git with Yum on CentOS 8
One of the simplest and easiest ways to install Git is with a yum package manager, but the available version may be older than the newest version available. If you want to install the newest release of Git, consider compiling it from source (instructions for compiling Git from the source given further down below).
Once installed git, you can verify the version of installed Git using the following command.
Installing Git from Source Code
If you want to feature by a specific version of Git or need flexibility in installation then one of the best methods is to gather the software Git from Source. However, it will not manage and update Git installation through the yum package manager but will allow you to install the latest version of Git and customize the build options. This method is a bit lengthy process.
Before we move forward with the installation, you will need the following necessary tools to build the binary from the source.
Once the tools are installed successfully, open any browser and visit Gits project’s mirror on GitHub Release. The one at the top is the latest version of Git, but it may vary at your end. Now, look at the version you require then right-click the source code (tar.gz) and copy the link to download using following wget command as shown.
Once the download is completed unzip the source package using tar command, now move into the directory.
Now install and build Git from source using the following command.
Once compilation finishes, you can type the following command to verify the Git Version installation.
Configuring Git
Now git is installed on the CentOS machine successfully, now you will need to set up your personal info which will be used when you commit any changes to your code.
To verify that the above settings were added successfully, you can list all of the configuration settings that have been added by typing.
The above settings are stored in the global configuration ~/.gitconfig
file. To make any additional changes to this file, use git config
command or edit the file manually.
No comments:
Post a Comment