centos6.5安装git

软件包链接:https://git.kernel.org/pub/scm/git/git.git/snapshot/git-2.7.2.tar.gz

官网链接:https://git.kernel.org/pub/scm/git/git.git/refs/tags

wget下载https开头的网址域名 时报错,你可能需要加上 --no-check-certificate 选项

例如:wget --no-check-certificate https://git.kernel.org/pub/scm/git/git.git/snapshot/git-2.7.2.tar.gz

1、安装编译git时需要的包

# yum -y install gcc openssl openssl-devel curl curl-devel unzip perl perl-devel expat expat-devel zlib zlib-devel asciidoc xmlto gettext-devel openssh-clients

2、新建文件夹 mkdir

# cd /usr/local

# mkdir  git

3、下载解压tar包

#wget --no-check-certificate https://git.kernel.org/pub/scm/git/git.git/snapshot/git-2.7.2.tar.gz

# tar xzf git-2.7.2.tar.gz

4、编译安装

# make prefix=/usr/local/git all doc

# make prefix=/usr/local/git install

5、 配置环境变量

# vim /etc/profile

底部追加 export PATH=/usr/local/git/bin:$PATH

# source /etc/profile  使更新生效

6、安装成功

      git --version

显示版本号“git version 2.7.2”

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容