【问题标题】:Error linking git to homebrew [duplicate]将git链接到自制软件时出错[重复]
【发布时间】:2014-01-06 01:06:46
【问题描述】:

我正在关注Luke Jones' article on setting up a local server,我目前正在尝试在 Mavericks 上使用 git 设置自制程序。在安装自制软件之前,我已经安装了 git。我遇到了一个与this question 类似的问题,但是当我尝试运行brew link git 时,我收到了以下错误:

Error: Could not symlink file: /usr/local/Cellar/git/1.8.5.1/share/git-core/templates/info/exclude
Target /usr/local/share/git-core/templates/info/exclude already exists. You may need to delete it.
To force the link and overwrite all other conflicting files, do:
  brew link --overwrite formula_name

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

我的/etc/paths

/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin

which git 返回/usr/bin/git

which brew 返回/usr/local/bin/brew

不确定是什么问题,因为我仍然不擅长解决此类问题。有人知道接下来要采取的步骤吗?

【问题讨论】:

    标签: git terminal homebrew osx-mavericks


    【解决方案1】:

    尝试按照错误消息中的建议覆盖链接:

     brew link --overwrite git
    

    您可以添加--dry-run 以在进行任何更改之前先检查它。

    【讨论】:

      【解决方案2】:

      对于将来遇到问题的其他人:

      我现在将 git 与 homebrew 链接。我安装了Mac Github client,它可能使某些文件无法写入(this post 提示我),所以我用AppCleaner 卸载了它,重新启动了我的终端,卸载了所有版本的 git,运行sudo brew prune 来清理东西起来,并通过 brew 使用brew install git 重新安装 git。然后我运行brew link git,它工作得很好。

      我相信其他人可能对所发生的事情有更好的解释,其中一些步骤可能有点矫枉过正,但它对我有用!

      【讨论】:

      • 谢谢,谢谢,谢谢。
      猜你喜欢
      • 1970-01-01
      • 2016-02-15
      • 2022-07-27
      • 1970-01-01
      • 1970-01-01
      • 2017-07-16
      • 1970-01-01
      • 1970-01-01
      • 2015-03-23
      相关资源
      最近更新 更多