How to install Git on CentOS 8

Version control system tools plays a vital role in today's modern software development. Version control is a kind of software that helps a group of software developers work together and manage work history. It does not cover other people's changes, so you can track every change to restore a file or project to a previous state.

Version control tool to help you very easily recover lost files. If the team any person who commits a mistake, you can review and compare the earlier version of the file, and fix any errors or conflicts.

Git developer is used to coordinate the work of the most popular distributed version control among them one of the tools. It is composed of Linus Torvalds (creator of the Linux kernel) in 2005 design.

Git provides such data assurance, workflow, create a branch, to restore the previous stage, incredible speed, tracking code changes, view the log and other functions. It allows you to work in offline mode, ready, then you need an Internet connection to publish the changes and make the most recent changes.

For example, you want to permanently keep Git users will use yum update method, but users who need a specific version of Git source code will function method.

IMPORTANT: You must install and configure the sudo users with root privileges CentOS 8 server. If not, you can create a sudo account

Git using Yum mounted on CentOS 8

Use yum package manager is one of the simplest, easiest way to install Git, but the available version may be older than the latest version available. If you want to install the latest version of Git, please consider compiling from source code (for instructions on compiling from source Git, see below).

How to install Git on CentOS 8

Once the git installed, you can use the following command to verify the installed version of Git.

git version 2.18.1

 How to install Git on CentOS 8

Git source installation

If you want to use a specific version of Git, or the flexibility to be installed, then one of the best ways is to Git from source code collection software. However, it does Git installed via yum package manager to manage and update, but allows you to install the latest version of Git and custom build options. This method is a bit long process.

Before proceeding with the installation, you will need the following tools necessary to build binaries from source code.

How to install Git on CentOS 8

How to install Git on CentOS 8

After successful installation tool, open any browser and go to the mirror Gits project on GitHub Release. Top of the latest version of Git, but in the end may vary. Now, see what version, then right-click on the source code (tar.gz), and use the following wget command to copy the download link, as shown below.

How to install Git on CentOS 8

Once downloaded, unzip the tar command source software package, now move to the directory.

Now, using the following command to install from the source code and build Git.

[root@localhost git-2.23.0]# sudo make prefix=/usr/local all install

How to install Git on CentOS 8

After compilation, you can type the following command to verify the Git version installed.

How to install Git on CentOS 8

Configuration Git

Now git has been successfully installed on a CentOS machine, now you need to set your personal information when you make any changes to the code will use the personal information.

To verify successfully added the above settings, you can list all the configuration settings have been added by typing.

How to install Git on CentOS 8

The above settings are stored in global configuration ~ / .gitconfig file. To any other changes to this file, please use the git config command or manually edit the file.

to sum up

that's it! In this article, we explain how to use yum and source code to install Git on CentOS 8 server. If you have any questions, please leave a message in the following column published in your mind.

Guess you like

Origin www.linuxidc.com/Linux/2019-10/161215.htm