Centos install git source package

  1. Download the source package from github: https://github.com/git/git
  2. Unzip the source package
  3. cd /usr/local/src/git-master
  4. make prefix=/usr/local all
  5. make prefix=/usr/local install

If this error is reported: make: * [git-credential-store] Error 1
Solution:

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
Then go back to git to continue compiling:

  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

    Check the git version: git --version

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325649086&siteId=291194637