« Small tweak to my mail setup | Main | No more bazzilion git-* commands »

x-git-update-to-latest-version

This morning in the git mailing list, I wrote a small shell recipe to update your git to the latest version but keeping the previous ones around, in case something goes wrong.

I noticed that what I wrote was a lot better than the hack-and-slash script I was using, so I promoted a cleaned up version of that to my scripts stash. Hence, you can now download x-git-update-to-latest-version and enjoy painless git updates.

You need to tweak two things at the top of the script:

  • the location on your hard drive of the git.git clone (you need to create that with git clone git://git.kernel.org/pub/scm/git/git.git first);
  • the base directory where all the git versions will live.

You'll end up with something like this (I use /usr/local as my base directory):

melo@MrTray:melo $ ls -dla /usr/local/git*
lrwxr-xr-x   1 root  wheel   25 Jul  4 10:05 /usr/local/git -> git-v1.5.6.1-204-g6991357
drwxr-xr-x   7 root  wheel  238 Jul  4 10:05 /usr/local/git-v1.5.6.1-204-g6991357

Each version will be named git-VERSION where VERSION is the output of git-describe. A symbolic link named git points to the latest version.

Just add BASEDIR/git/bin to your PATH and your are done.

Contacts

melo@simplicidade.org (XMPP/email)
+351 302 029 050 (voice)
melopt (Skype)

IronMan challenge

Iron Man badge Are you ready to be an Iron Man? Join the challenge and find out! (what is the meaning of this little man?)

Moosaico

Junta-te!

Recent Comments

Powered by Disqus
Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 3.2