Git requires jumping through a hoop, since it will install a full tree under the specified prefix (e.g., $prefix/usr/local/bin/git
).
A couple of convenience variables.
old=2.2.1 ;# old version installed with Stow
new=2.4.0-rc2 ;# new version to be installed with Stow
Fetch the source.
git clone https://github.com/git/git.git
cd git
git clean -dfx ;# if this path has been used to build before
git checkout v$new
Build Git, installing it to a temporary location.
PATH=/bin:/usr/bin:/usr/local/bin make prefix=/usr/local DESTDIR=/tmp/git-$new all doc info
PATH=/bin:/usr/bin:/usr/local/bin make prefix=/usr/local DESTDIR=/tmp/git-$new install install-doc install-html install-info
Move Git to the Stow directory.
sudo mkdir /usr/local/stow/git-$new
sudo mv /tmp/git-$new/usr/local/* /usr/local/stow/git-$new/
Stow the new Git.
sudo stow -d /usr/local/stow --delete git-$old
sudo stow -d /usr/local/stow --stow git-$new