使用Homebrew安装Git时出现警告

时间:2014-10-11 20:46:12

标签: git homebrew

使用Homebrew安装Git时出现以下警告:

Warning: git-2.1.1 already installed, it's just not linked

我一直在尝试用Homebrew更新我的Git版本:

brew upgrade Git

并收到此消息:     错误:未安装git

然后我使用了命令:brew install git 并收到此消息:

Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/git
Target /usr/local/bin/git
already exists. You may want to remove it:
  rm /usr/local/bin/git

To force the link and overwrite all conflicting files:
  brew link --overwrite git

To list all files that would be deleted:
  brew link --overwrite --dry-run git

我尝试了overwrite命令并收到此错误:     错误:无法符号链接share / git-core / contrib     / usr / local / share / git-core不可写。

然后我运行git --version并收到:     -bash:/ usr / local / bin / git:没有这样的文件或目录

然后运行brew install Git并收到:     警告:已经安装了git-2.1.1,它只是没有链接

我完全不知道该做什么。任何帮助将非常感激。提前谢谢!

1 个答案:

答案 0 :(得分:2)

尝试此操作:删除/usr/local/share/git-core,然后重新安装git。