标签:/etc/ .tar.xz centos 6 profile mon centos color 源码编译 rap
CentOS 6自带的git版本是1.7安装编译环境
安装gcc
# yum install gcc gcc-c++ autoconf make automake -y
安装编译所需的包
# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel -y # yum install perl docbook2X texinfo sgml2xml openjade perl-ExtUtils-MakeMaker -y # yum install asciidoc xmlto cpio expat-devel gettext-devel -y
卸载自带的git
# yum remove git
源码编译git
下载最新版
# cd /data/toots/ # wget https://www.kernel.org/pub/software/scm/git/git-2.9.5.tar.xz
解压
# tar zxvf git-2.9.5.tar.xz # cd git-2.9.5
编译安装
# make configure # ./configure --prefix=/usr/local/git --with-iconv=/usr/local/libiconv // 配置安装路径 # make all doc // 编译 # make install install-doc install-html // 安装
修改环境变量
# echo -e "# git\nexport PATH=/usr/local/git/bin:\$PATH"> /etc/profile.d/git.sh # cat /etc/profile.d/git.sh \# git // 文件内容 export PATH=/usr/local/git/bin:$PATH # source /etc/profile
查看是否安装成功
# git --version
在pycharm中修改git指向
File->Settings->Version Control->Git->Path to Git executable:
选择/usr/local/git/bin/git
标签:/etc/ .tar.xz centos 6 profile mon centos color 源码编译 rap
原文地址:http://blog.51cto.com/moerjinrong/2059905