git from source on Centos 7

As for many packages, git is fairly old on CentOS 7. The version they provide lacks a feature that I rely on, namely the -C switch, to be able to call git anywhere, without having to cd to the git directory first.

These are the steps I took to build git on CentOS 7:

yum -y install gcc make gettext-devel openssl-devel perl-devel curl-devel expat-devel
curl https://www.kernel.org/pub/software/scm/git/git-2.10.2.tar.gz | tar xzf -
cd git-2.10.2
make prefix=/usr/local -j $(nproc)
make install prefix=/usr/local
git --version
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s