Install exact version via brew

For instance, we’re looking for kubernetes-helm@2.9

helm 2.9

Now we have needed version of helm.

If you see an error message like Error: go: unknown version :mountain_lion, you should make a little hack (as it said here). Check all the files depending on

In each file just comment a string saying depends_on :macos => :mountain_lion.
In my case commenting only in Formula/go.rb, Formula/go@1.8.rb, Formula/go@1.9.rb worked.

kubectl 1.13

If you need kubectl 1.13, you should do this:
git -C «$(brew —repo homebrew/core)» fetch —unshallow
cd «$(brew —repo homebrew/core)»
git log Formula/kubernetes-cli.rb
# searching for 2.9.0 with a command /1\.13\. and copying hash like «75af35f7bf344b6ac8436e3a60932504543d7012»
git checkout -b kubernetes-cli@1.13.4 75af35f7bf344b6ac8436e3a60932504543d7012
HOMEBREW_NO_AUTO_UPDATE=1 brew install kubernetes-cli
git checkout master
git branch -d kubernetes-cli@1.13.4


Another way

There is a completely different way to do this