brew update failure while executing git checkout

后端 未结 5 1679
青春惊慌失措
青春惊慌失措 2021-01-30 07:07

After an interrupted brew update because of a network issue, Homebrew appears to be broken:

$ brew update
error: pathspec \'master\' did not match a         


        
5条回答
  •  一向
    一向 (楼主)
    2021-01-30 07:24

    I had a similar problem where from /usr/local (== $(brew --prefix)) I tried the answer 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 was because I the hdf5 routine was in /usr/local/Library/tab/homebrew-science which has it's own git repository. To fix 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 version of the desired library (e.g. hdf5)

    Hope this helps someone!

提交回复
热议问题