centos安装git源码包

  1. 从github下载源码包:https://github.com/git/git
  2. 解压源码包
  3. cd /usr/local/src/git-master
  4. make prefix=/usr/local all
  5. make prefix=/usr/local install

如果报这个错误: make: * [git-credential-store] 错误 1
解决办法:

cd /usr/local/src/
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
tar -zxvf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure -prefix=/usr/local/libiconv && make && sudo make install
然后回到git继续编译:

  1. cd /usr/local/src/git-master
  2. make configure
  3. ./configure –prefix=/usr/local -with-iconv=/usr/local/libiconv
  4. make
  5. make install

    查看git版本: git –version

猜你喜欢

转载自blog.csdn.net/qq_14922059/article/details/52643710