How do I install a specific release of a Homebrew formula on GitHub?

Not sure whether this is a good idea or not, but it does seem like you can install from an older commit.

So for example the following command seems to work to download, build and install version 2017.05.02.01 of buck. Note that it will try to download and compile from source because the binaries have been deleted from the repo.

brew install https://raw.githubusercontent.com/facebook/homebrew-fb/7511722fd58e999e5d8c3a415d4e8cd1deee8f21/buck.rb

I got to this by:

  1. Going into the commit history of homebrew-fb
  2. Clicking on the <> button for the "Update buck.rb to v2017.05.02.01" commit to take me into the repository as it existed with that commit
  3. Selecting the buck.rb file
  4. And lastly clicking the "Raw" button to get the url directly to that specific version of the buck.rb

A more expanded version of the above with a couple additional tricks can be found on StackOverflow.

https://stackoverflow.com/a/53766019/3794873

One thing to keep in mind is that if you are installing an older Formula the Homebrew API/methods may have changed since that time so you should brew edit appFormula against the current version and compare to the brew edit [email protected] if you encounter any errors trying to brew install [email protected] after the brew extract command in the answer linked.