[ACCEPTED]-brew update failure while executing git checkout-homebrew
Fixed with the following commands:
$ cd `brew --prefix`
$ git remote add origin https://github.com/Homebrew/homebrew.git
$ git fetch origin
$ git reset --hard origin/master
$ brew update
Already up-to-date.
0
when i try it, sudo is needed:
$ git reset --hard origin/master
error: unable to unlink old 'Library/Homebrew/macos/xcode.rb' (Permission denied)
fatal: Could not reset index file to revision 'origin/master'.
$ sudo !!
sudo git reset --hard origin/master
Password:
HEAD is now at 97302bf xrootd 3.2.2
0
In my case, I had just upgraded to OS X 5 El Capitan and none of the other solutions 4 worked.
I took note of the packages in /usr/local/Cellar 3 and then deleted the Cellar folder and started 2 with a fresh install.
rm -rf /usr/local/Cellar
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install )"
Then I brew installed 1 the packages again.
I had a similar problem where from /usr/local 7 (== $(brew --prefix)) I tried the answer 6 by @ Julien Carsique but still got the error:
[local]master$ git checkout 3115d85 hdf5.rb
error: pathspec '3115d85' did not match any file(s) known to git.
error: pathspec 'hdf5.rb' did not match any file(s) known to git.
This 5 was because I the hdf5 routine was in /usr/local/Library/tab/homebrew-science 4 which has it's own git repository. To fix 3 this I entered:
[local]master$ cd Library/Taps/homebrew/homebrew-science/
[homebrew-science]master$ git checkout 3115d85 hdf5.rb
Now I can install a previous 2 version of the desired library (e.g. hdf5)
Hope 1 this helps someone!
What solved Homebrew git errors for me was 4 simply to cd ~
and run brew update
in my home directory. The 3 command failed when I was in a folder shared 2 on GitHub. Also, clang
magically appeared again 1 from brew config
after cd ~
.
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.