Skip to content

Instantly share code, notes, and snippets.

@haf
Created August 22, 2012 14:38
Show Gist options
  • Save haf/3426227 to your computer and use it in GitHub Desktop.
Save haf/3426227 to your computer and use it in GitHub Desktop.
Installing git and git-subtree from source in ubuntu as packages
# use with: curl -L https://raw.github.com/gist/3426227 | bash
# get git binary, then git with git
sudo apt-get install git -y
git clone https://github.com/git/git.git
# remove your binary/package
sudo apt-get remove git -y
sudo apt-get install make checkinstall libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev asciidoc -y
# build git & install it
cd git
make prefix=/usr/local all
sudo checkinstall --pkgname=git make prefix=/usr/local install
# build subtree & install it
cd contrib/subtree
make prefix=/usr/local
sudo checkinstall --pkgname=git-subtree make prefix=/usr/local install
sudo checkinstall --pkgname=git-subtree-doc make prefix=/usr/local install-doc
# clean up afterwards
sudo apt-get remove -y libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev asciidoc
sudo apt-get autoremove -y
@haf
Copy link
Author

haf commented Aug 22, 2012

Test it with vagrant!

$ sudo apt-get install vagrant -y
$ vagrant init precise32
$ vagrant up
$ vagrant ssh
vagrant@precise32$ sudo apt-get install -y curl
vagrant@precise32$ curl -L https://raw.github.com/gist/3426227 | bash

@haf
Copy link
Author

haf commented Aug 22, 2012

PS, if you don't have that box:

vagrant box add precise32 http://files.vagrantup.com/precise32.box

@shadyvb
Copy link

shadyvb commented Oct 5, 2013

It seems there is something wrong with gist urls, this works now

curl -L https://gist.github.com/haf/3426227/raw/b9a3037a319d31c8bd898760331c4e4c2824ddce/install-git.sh | bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment