Skip to content

Instantly share code, notes, and snippets.

@gschizas
Last active March 31, 2018 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gschizas/cc40970bce2c77898ad416808449dcd8 to your computer and use it in GitHub Desktop.
Save gschizas/cc40970bce2c77898ad416808449dcd8 to your computer and use it in GitHub Desktop.
Build and install git from sources
#!/usr/bin/env sh
ver=$(curl https://api.github.com/repos/git/git/tags | jq -r 'first(.[].name | select(test("v\\d\\.\\d+\\.\\d+$")))[1:]')
sudo apt install -y \
dh-autoreconf libcurl4-gnutls-dev libexpat1-dev \
gettext zlib1g-dev libssl1.0-dev \
asciidoc xmlto docbook2x
# getopt
wget -c https://github.com/git/git/archive/v$ver.tar.gz -O git-$ver.tar.gz
tar -xzvf git-$ver.tar.gz
cd git-$ver/
make configure
./configure --prefix=/usr
make all doc info
sudo make install install-doc install-html install-info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment