【问题标题】:Warning when installing Git with Homebrew使用 Homebrew 安装 Git 时出现警告
【发布时间】:2014-10-11 20:46:12
【问题描述】:

使用 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

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

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

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

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

【问题讨论】:

    标签: git homebrew


    【解决方案1】:

    试试这个:删除/usr/local/share/git-core,然后安装git重试。

    【讨论】:

    • 我跑了: rm /usr/local/share/git-core 并收到: rm: /usr/local/share/git-core: 是一个目录,所以我跑了: rmdir /usr/ local/share/git-core 并收到:rmdir: /usr/local/share/git-core: Directory not empty
    • 你必须递归删除一个目录,所以rm -r 命令或rm-rf 所以它不会提示你每个文件。这是因为你的目录不是空的,里面有文件。
    • 运行 rm-rf 并获得权限被拒绝 目录不为空。
    • 想我明白了。似乎是一个符号链接问题。 Ran brew doctor 并遵循建议。还有一个我修复的可写错误。现在一切似乎都在工作。手指交叉。感谢 Albert 为您提供帮助。非常感谢!
    猜你喜欢
    • 2012-09-03
    • 1970-01-01
    • 1970-01-01
    • 2013-12-13
    • 1970-01-01
    • 2022-10-14
    • 2011-11-15
    • 2021-07-30
    • 2016-09-04
    相关资源
    最近更新 更多