Make a GitHub repository that conforms to the naming scheme $username/homebrew-$tapname
.
It can be empty or already exist, it doesn't matter.
Get the formula at the version you want with brew extract $package $username/homebrew-$tapname --version=$version
This will automatically tap
your tap, but if you want to add this to another machine, you'll have to:
- commit and push your changes from the
$(brew --prefix)/Homebrew/Library/Taps/$username/
directory, brew tap $username/$tapname
from the machine you want to add the tap to.
To install, brew install $package@$version
.
This will produce a bunch of errors, which is expected because the links will conflict with the already installed newer package.
Override them with brew link --override $package@$version
.
To get the latest version back, brew unlink $package && brew unlink $package@$version && brew link $package
.