问题
I deleted some of .rb files(cassandra.rb,cassandra@2.1.rb and cassandra@2.2.rb) from folder /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ from mac system.I want back those .rb files.
I thought brew upgrade will give me back those deleted .rb files back.But they are still missing. Those .rb files are important for me to install packages.
brew install cassandra gives
Updating Homebrew...
Error: No available formula with the name "cassandra"
==> Searching for a previously deleted formula...
cassandra was deleted from homebrew/core in commit d20fe73:
cassandra: update 3.10_1 bottle.
To show the formula before removal run:
git -C "$(brew --repo homebrew/core)" show d20fe73^:Formula/cassandra.rb
If you still use this formula consider creating your own tap:
http://docs.brew.sh/How-to-Create-and-Maintain-a-Tap.html
Please I need solution "how to get back these .rb files?" or "any other alternative way to install cassandra".
回答1:
Install directly from GitHub as mentioned here - How to restore brew formula after I rm it
brew install https://github.com/Homebrew/homebrew-core/tree/master/Formula/cassandra.rb
回答2:
Try this command to bring back all of deleted files.
Note: This command will revert all change in $(brew --repo homebrew/core)
cd $(brew --repo homebrew/core) && git reset --hard origin/master
Homebrew uses git internally, so use git commands to repair some problem.
来源:https://stackoverflow.com/questions/43234347/how-to-get-back-homebrew-to-previous-state