CentOS6.8使用源码安装Git

一、安装git所需的依赖

sudo yum groupinstall "Development Tools"
sudo yum install gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel

二、去GitHub下载最新发布包 Git下载地址

wget https://github.com/git/git/archive/v2.1.2.tar.gz -O git.tar.gz

三、解压源码包

tar -zxf git.tar.gz

四、进到源码文件

cd git-*

五、配置目标编译目录

make configure
./configure --prefix=/usr/local

六、开始编译安装

sudo make install

七、安装完成,检查版本号

git --version

八、配置Git用户名及邮箱

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

九、查看Git配置

git config --list
user.name=Your Name
user.email=you@example.com

参考:https://www.digitalocean.com/community/tutorials/how-to-install-git-on-centos-7

 

后记:关于git clone: fatal: Unable to find remote helper for 'https'问题

解决方案:

1、系统中安装curl

yum install curl-devel
2、重新编译安装Git
posted @ 2016-12-19 14:03  i迷倪  阅读(2307)  评论(0编辑  收藏  举报