- Download the source package from github: https://github.com/git/git
- Unzip the source package
- cd /usr/local/src/git-master
- make prefix=/usr/local all
- 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:
- cd /usr/local/src/git-master
- make configure
- ./configure –prefix=/usr/local -with-iconv=/usr/local/libiconv
- make
make install
Check the git version: git --version