标签:地址 www nload pen /usr linu 版本 open 技术分享
下载地址:https://git-scm.com/download/linux
如上图,整个网页最下面有centos版本的tar包,点红框链接,进去就是下面这个链接。
https://www.kernel.org/pub/software/scm/git/
选择最新版本,我喜欢在windows下载好后,拷贝到centos。
[root@localhost /]# mkdir /soft
利用WinSCP将git拷贝到centos,放在/soft目录。
安装gcc
[root@localhost ~]# yum install gcc
安装g++
[root@localhost /]# yum install gcc-c++
安装编译所需的包
[root@localhost /]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
[root@localhost /]# yum install gcc perl-ExtUtils-MakeMaker
[root@localhost soft]# cd /soft
[root@localhost soft]# tar zxvf git-2.14.0.tar.gz
[root@localhost soft]# cd git-2.14.0/
[root@localhost git-2.14.0]# ./configure --prefix=/usr/local/git-2.14.0 && make install
这句命令的意思是:编译并指定安装目录、安装
[root@localhost bin]# vi /etc/profile
然后输入双引号里面的命令:”:$”,跳到文件最后一行
export PATH=$PATH:/usr/local/git-2.14.0/bin
将上面这行代码拷贝到文件末尾,并保存
[root@localhost bin]# source /etc/profile
[root@localhost bin]# git --version
[root@localhost local]# cd /soft
[root@localhost soft]# rm -rf git-2.14.0
so easy...
如果安装有问题,可联系我。
标签:地址 www nload pen /usr linu 版本 open 技术分享
原文地址:http://www.cnblogs.com/subendong/p/7667443.html