Skip to content

Instantly share code, notes, and snippets.

@amercier
Last active January 3, 2016 05:29
Show Gist options
  • Save amercier/8415763 to your computer and use it in GitHub Desktop.
Save amercier/8415763 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
if [ "`whoami`" != "root" ]; then
echo "You must execute this script as root" >&2
exit 1
fi
VERSION=1.9.0
echo ".------------------."
echo "| Git installation |"
echo "'------------------'"
cd \
&& aptitude install make libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev asciidoc \
&& curl -# https://git-core.googlecode.com/files/git-$VERSION.tar.gz -o git-$VERSION.tar.gz \
&& tar xvfz git-$VERSION.tar.gz \
&& cd git-$VERSION \
&& make prefix=/usr/local all \
&& make prefix=/usr/local install \
&& cp contrib/credential/netrc/git-credential-netrc /usr/local/libexec/git-core/ \
&& cp contrib/diffall/git-diffall /usr/local/libexec/git-core/ \
&& cd ~/git-$VERSION/contrib/subtree \
&& make prefix=/usr/local install \
&& make prefix=/usr/local install-doc \
&& cd \
&& rm -Rf git-$VERSION git-$VERSION.tar.gz \
&& echo ".----------------------------." \
&& echo "| Git installed successfully |" \
&& echo "'----------------------------'" \
&& git --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment