Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to install git in centos7.2 system

Shulou Source: shulou.com Published: 2022-06-02 11:08:13 11月28日 Update

It is believed that many inexperienced people have no idea about how to install git in centos7.2 system. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

1. Install git through yum:

Yum install git / / Git is installed in the / usr/libexec/git-core directory by default

Git-- version / / View version

two。 Install by compiling the source code:

Step one:

Wget https://github.com/git/git/archive/v2.17.0.tar.gz

Step 2:

Tar-zxvf v2.17.0.tar.gz

Step 3:

Yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker / / wait patiently for installation. Just enter y when prompted.

Step 4: when installing dependencies, yum automatically installs Git, and you need to uninstall the old version of Git with the following command:

Yum remove git

Step 5: go to the unzipped folder to compile and command cd git-2.17.0

Make prefix=/usr/local/git all

Step 6:

Install the Git to / usr/local/git path with the command

Make prefix=/usr/local/git install

Step 7: open the environment variable configuration file, command vim / etc/profile, and add Git-related configuration information at the bottom:

PATH=$PATH:/usr/local/git/bin

Export PATH

Then save and quit!

Step 8:

Enter the command git-- version to view the installed version of git. The verification passed and the installation was successful.

Configure the git user name:

Git config-global user.name "username"

Git config-global user.email "XXXX@XX.com"

View commands:

Git config-global user.name

Git config-global user.email

Set ssh to generate the public key:

Ssh-keygen-t rsa-C "XXXXX@qq.com" / / later, just press enter.

Enter the user directory to view the public key:

Cd / .ssh

Ls

Cat id_rsa.pub / / View the contents of the public key and configure it to Ciyun or github

If you need to enter the account password for every git pull operation

Then run it once

Git bash enter your project directory and type:

Git config-global credential.helper store

After reading the above, have you mastered how to install git in centos7.2 system? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Commands inputs configurations public keys contents versions directories systems files methods more users problems compilation success patience helplessness for this information reasons Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Huawei Redmi vpn Shulou Technology