In other words, is there a tool for managing versions of git, similar to what nvm and rvm do for node and ruby (respectively)?
EDIT:
I guess the title of my question is kind of misleading. I don't really want to work with multiple versions at the same time, per se. It's just annoying to download source tarballs and build/install manually. It would be wonderful to simplify the process. While there are general package management tools such as brew
, yum
, and apt
, they can be slow to get updated and they differ between platforms. Having one simple interface to install/upgrade git would make me happy :)
Let's say I want to stay up-to-date with the latest git version, or even newly install in a fresh box/account, without having to do all the build steps manually. In my perfect world, it would be as easy as just doing something like this:
$ git --version
-bash: git: command not found
$ curl -sL https://SOMEURL | bash use latest
downloading v1.8.0...
building v1.8.0...
done!
using git v1.8.0
$ git --version
git version v1.8.0
$ gvm ls
v1.8.0
* default -> 1.8 (v1.8.0)
Or, upgrading like follows:
$ git --version
git version 1.7.9.1
$ gvm ls
v1.7.9.1
v1.7.8
v1.7.7.5
* default -> 1.7 (v1.7.9.1)
$ gvm install latest
downloading 1.8.0...
building 1.8.0...
done!
$ gvm alias default 1.8
$ gvm use default
now using git v1.8.0
$ git --version
git version 1.8.0
$ gvm ls
v1.8.0
v1.7.9.1
v1.7.8
v1.7.7.5
* default -> 1.8 (v1.8.0)