Install specific version of software using mac homebrew - SeanHolden/Wiki GitHub Wiki

For example, I needed to install version 2.0.4 of redis.

First, ensure you have removed any other version of the software you need... (e.g. remove redis in this case).

Then... find the current version of redis in homebrew...

(e.g. https://github.com/Homebrew/homebrew/blob/master/Library/Formula/redis.rb)

Then look in the commit history until you find the specific commit containing the version you need. In this case I found the commit for version 2.0.4. Get the raw file from that commit, and save it as, for example, redis204.rb.

Then open the file, edit the class name to be the same as the filename... e.g. class Redis204.

Add it to the other homebrew formulas at /usr/local/Library/Formula.

Run brew install redis204

...That should do it!