qkqu_q
Last Updated: February 25, 2016
·
1.764K
· adamme

Get the head version of a package with Homebrew on OS X

Those who do not use Homebrew as a package manager on OS X yet, you are missing a lot of fun and convenience. Check Homebrew out.

I'll take Git as an example.

Usually we do:

brew install git

to get the latest stable version (1.9.2, as of the time of writing this tip) of Git.

If you are brave enough to test an edge version, just add the --HEAD parameter like this:

brew install --HEAD git

You'll get Git 2.0.0.rc2 as of the time of writing.

If you already have the stable Git installed, the above command will cause brew to complain. It's OK, just use reinstall:

brew reinstall --HEAD git

And you'll be fine.

Note:

  1. The parameter --HEAD has to be all capitalized, or brew will raise a complaint.
  2. You can run brew cleanup to get rid of package leftovers.