Install git 2.11 on CentOS 6

There is only git 1.7.x for CentOS 6. I am trying to build something with golang then founds out that “go get” cannot working correctly with older git. But I cannot find git binary new enough. So I build one from source. Why did I take note on this?
There are some missing link.
First get all dependencies

yum install perl cpio curl curl-devel zlib-devel openssl-devel expat-devel gettext-devel gcc perl-ExtUtils-MakeMaker

Generate configure executable

make configure

Config build environment and binary prefix, I have manage to install git to /usr/local/bin

 ./configure --prefix=/usr/local

Now, let’s build it.

make

Install it.

make install

Check if your installed binary have higher priority at PATH. If not, make sure you have put /usr/local/bin in front of /usr/bin(where old git binary located).
Last think to check, check git version.

git --version

If you git the version number you want to see. You made it. I am running on “git 2.11.0 rc2”.

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *