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
écrivain et éditeur

Après plusieurs vies, j’écris maintenant