Linux system installation Git (graphic)

Recently, I set up a beggar version of the cloud server, thinking that I can't waste it. Ready to fiddle with a Git on the server, just do it~

Next, I will provide the graphic steps

Since the Git tool was not installed in the server environment before, first install the tool dependencies as usual

yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker

Press Enter to install. There is one thing to pay attention to during the execution process. There is such a paragraph in the execution log during the execution of the above command:

Students with good eyesight should find that during the execution process, a default (grandfather) version of the Git tool is automatically installed.

So before installing our own Git, perform an uninstallation operation. If you find it troublesome, you can use this version. You can ignore it below

 Execute the script to uninstall

Then get the version of the Git website response via wget

wget https://www.kernel.org/pub/software/scm/git/git-2.38.1.tar.gz

The download address I chose is /usr/src, unzip the file under this folder

Next, we choose the address where we choose Git to compile and install. In line with the idea that those who can do more work, of course, it must be installed on a large-capacity mounted optical drive. The following statement can be used to determine the drive letter on which the relevant folder is mounted:

#查看资源分配
df -h
#查看文件夹挂载的盘
df 文件夹路径

 Next, compile and install

#编译,路径随自己选择
make prefix=/data/git_2.38.1 all
#安装
make prefix=/data/git_2.38.1 install

After the execution is completed and no error is reported, the finishing work of the environment variable configuration can be carried out.

#全局变量设置
vim /etc/profile

#将下面的指令复制到profile文件末尾

#Git Environment Variable
export GIT_HOME=/data/git_2.38.1/bin
export PATH=$PATH:$GIT_HOME;

#保存退出文件后
source /etc/profile

#最后通过命令校验安装结果
git --version

The following prompt will appear:

Guess you like

Origin blog.csdn.net/weixin_42505381/article/details/128235676