2016-09-21 35 views
30

不知道这个问题是有关升级到Mac系统塞拉利昂,但因为那一刻,当我运行“酿造更新”家酿致命的:需要一个版本(Mac系统塞拉利昂)

→ brew update 
Checking out v1.0.0 in /usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask... 
To checkout master in /usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask run: 
    'cd /usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask && git checkout master 
fatal: Cannot update paths and switch to branch 'v1.0.0' at the same time. 
Did you intend to checkout 'refs/tags/1.0.0' which can not be resolved as commit? 
fatal: Needed a single revision 
invalid upstream refs/tags/1.0.0 
Checking out v1.0.0 in /usr/local/Homebrew/Library/Taps/dart-lang/homebrew-dart... 
To checkout master in /usr/local/Homebrew/Library/Taps/dart-lang/homebrew-dart run: 
    'cd /usr/local/Homebrew/Library/Taps/dart-lang/homebrew-dart && git checkout master 
fatal: Cannot update paths and switch to branch 'v1.0.0' at the same time. 
Did you intend to checkout 'refs/tags/1.0.0' which can not be resolved as commit? 
fatal: Needed a single revision 
invalid upstream refs/tags/1.0.0 
Checking out v1.0.0 in /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core... 
To checkout master in /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core run: 
    'cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core && git checkout master 
fatal: Cannot update paths and switch to branch 'v1.0.0' at the same time. 
Did you intend to checkout 'refs/tags/1.0.0' which can not be resolved as commit? 
fatal: Needed a single revision 
invalid upstream refs/tags/1.0.0 

我想发生这个错误运行

cd $(brew --prefix) && git fetch && git reset --hard origin/master 

但它给我这个错误:

fatal: Not a git repository (or any of the parent directories): .git 
+1

我得到这个过了,我还没有升级到塞拉利昂。不过我已经升级到Brew 1.0 – SCdF

回答

58

我UPG后有同样的问题冲撞塞拉利昂。

除了显示Homebrew的安装路径的brew --prefix之外,还有brew --repository,它显示.git目录所在的位置。

man brew说,声称“为标准安装,前缀和存储库是相同的目录”。无论是男人页过时的或我的安装是不是“标准”,但我的prefix/usr/local和我repository/usr/local/Homebrew

使用相同的命令,而是cd $(brew --repository)为我工作:

cd $(brew --repository) && git fetch && git reset --hard origin/master 
+9

完全修复:'$ CD(BREW --prefix)/自制&& git的提取&& git的复位 - 硬起源/ master'的 –

+4

AKA'酿造--repository' – robertklep

+0

编辑补充完整的命令和关于'brew --repository'的信息。谢谢! – thomasd

2

接受的答案并没有为我工作。什么工作是卸载homebrew并重新安装:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)" 
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 
brew analytics off 
0

真的没什么工作对我来说,我不得不求助于卸载并重新安装的Brew:

# change to home directory to avoid other errors later 
cd ~ 

# uninstall brew 
rm -rf /usr/local/Cellar /usr/local/.git && cd ~ && brew cleanup 

# reinstall brew 
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"