Skip to content

Instantly share code, notes, and snippets.

@waleedsamy
Forked from matthewriley/gist:4694850
Last active June 24, 2016 10:16
Show Gist options
  • Save waleedsamy/baebc5af66390425f0e4 to your computer and use it in GitHub Desktop.
Save waleedsamy/baebc5af66390425f0e4 to your computer and use it in GitHub Desktop.
Install Git from source
# Install Git from source
# usage: curl https://gist.githubusercontent.com/waleedsamy/baebc5af66390425f0e4/raw/022bc3c16d18ed918822734a310ed5443f5f5286/igit.sh > ~/igit.sh && chmod +x ~/igit.sh && ~/igit.sh
gitversion=${1-2.9.0}
if [ "$(uname)" == "Darwin" ]; then
echo "Do something under Mac OS X platform like installing xcode"
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
sudo yum -y groupinstall "Development tools"
sudo yum -y install wget curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel
fi
wget -qO- https://github.com/git/git/archive/v$gitversion.tar.gz | tar xvz && \
cd ./git-$gitversion && make configure && ./configure && make && sudo make install && \
cp ./contrib/completion/git-completion.bash ~ && echo "source ~/git-completion.bash" >> ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment