问题描述
不知道这个问题是否与升级到MacOs Sierra有关,但从那一刻起,当我运行'brew update'时发生这个错误。
→brew更新
检出/ usr / local / Homebrew / Library / Taps / caskroom / homebrew-cask中的v1.0.0 ...
在/ usr / local / Homebrew / Library / Taps / caskroom / homebrew-cask run:
'cd / usr / local / Homebrew / Library / Taps / caskroom / homebrew-cask&& git checkout master
致命:无法同时更新路径并切换到分支v1.0.0。
您是否打算签出无法解析为提交的'refs / tags / 1.0.0'?
fatal:需要一次修订
无效上游refs / tags / 1.0.0
检出/ usr / local / Homebrew / Library / Taps / dart-lang / homebrew- dart ...
在/ usr / local / Homebrew / Library / Taps / dart-lang / homebrew-dart中结算master:
cd / usr / local / Homebrew / Library / Taps / dart -lang / homebrew-dart&& git checkout master
致命:无法同时更新路径并切换到分支v1.0.0。
您是否打算签出无法解析为提交的'refs / tags / 1.0.0'?
致命:需要单一修订
无效的上游引用/标记/ 1.0.0
检出/ usr / local / Homebrew / Library / Taps / homebrew / homebrew-core中的v1.0.0。 ..
在/ usr / local / Homebrew / Library / Taps / homebrew / homebrew-core运行:
'cd / usr / local / Homebrew / Library / Taps / homebrew / homebrew-core &安培;&安培; git checkout master
致命:无法同时更新路径并切换到分支v1.0.0。
您是否打算签出无法解析为提交的'refs / tags / 1.0.0'?
致命:需要单一修订
无效的上游refs / tags / 1.0.0
我试过运行
cd $(brew --prefix)&& git fetch&& git reset --hard origin / master
但它给了我这个错误:
fatal:不是git存储库(或任何父目录):.git
升级到Sierra后,我遇到了同样的问题。除了显示Homebrew的安装路径,还有 brew --prefix
,它还显示了它的位置 .git
目录位于
man brew
说声称对于标准安装,前缀和存储库是相同的目录。手册页已过期,或者我的安装不是标准,但是我的前缀
是 / usr / local
和我的仓库
是 / usr / local / Homebrew
。
使用相同的命令,但使用 cd $(brew --repository)
为我工作:
cd $(brew --repository)&& git fetch&& git reset --hard origin / master
Not sure if this problem is related to upgrading to MacOs Sierra, but since that moment this error occurs when I run 'brew update'
→ 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
I tried running
cd $(brew --prefix) && git fetch && git reset --hard origin/master
But it gives me this error:
fatal: Not a git repository (or any of the parent directories): .git
I had the same problem after upgrading to Sierra.
In addition to brew --prefix
, which displays Homebrew’s install path, there’s also brew --repository
, which displays where it’s .git
directory is located.
man brew
says that claims that "for standard installs, the prefix and repository are the same directory". Either the man page is out of date or my install isn’t "standard", but my prefix
is /usr/local
and my repository
is /usr/local/Homebrew
.
Using the same command but with cd $(brew --repository)
worked for me:
cd $(brew --repository) && git fetch && git reset --hard origin/master
这篇关于自制致命:需要单一版本(MacOs Sierra)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!