简体   繁体   English

Homebrew无法在安装过程中链接Git

[英]Homebrew can’t link Git during the installation

I can't seem to figure this out. 我似乎无法弄清楚这一点。 Homebrew can't link git during the installation. Homebrew在安装过程中无法链接git。 Here's what Terminal spits out: 以下是终端吐出的内容:

==> Downloading http://git-core.googlecode.com/files/git-1.8.4.tar.gz
Already downloaded: /Library/Caches/Homebrew/git-1.8.4.tar.gz
==> make prefix=/usr/local/Cellar/git/1.8.4 sysconfdir=/usr/local/etc CC=cc CFLA
==> make CC=cc CFLAGS= LDFLAGS=
==> make clean
==> make CC=cc CFLAGS= LDFLAGS=
==> Downloading http://git-core.googlecode.com/files/git-manpages-1.8.4.tar.gz
Already downloaded: /Library/Caches/Homebrew/git-manpages-1.8.4.tar.gz
==> Downloading http://git-core.googlecode.com/files/git-htmldocs-1.8.4.tar.gz
Already downloaded: /Library/Caches/Homebrew/git-htmldocs-1.8.4.tar.gz
==> Caveats
The OS X keychain credential helper has been installed to:
  /usr/local/bin/git-credential-osxkeychain

The 'contrib' directory has been installed to:
  /usr/local/share/git-core/contrib

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completion has been installed to:
  /usr/local/share/zsh/site-functions
Warning: Could not link git. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link git'

Possible conflicting files are:
/usr/local/share/git-core/templates/info/exclude -> /Applications/GitHub.app/Contents/Resources/git/share/git-core/templates/info/exclude
/usr/local/share/git-core/templates/hooks/update.sample -> /Applications/GitHub.app/Contents/Resources/git/share/git-core/templates/hooks/update.sample
/usr/local/share/git-core/templates/hooks/prepare-commit-msg.sample -> /Applications/GitHub.app/Contents/Resources/git/share/git-core/templates/hooks/prepare-commit-msg.sample
/usr/local/share/git-core/templates/hooks/pre-rebase.sample -> /Applications/GitHub.app/Contents/Resources/git/share/git-core/templates/hooks/pre-rebase.sample
/usr/local/share/git-core/templates/hooks/pre-push.sample -> /Applications/GitHub.app/Contents/Resources/git/share/git-core/templates/hooks/pre-push.sample
/usr/local/share/git-core/templates/hooks/pre-commit.sample -> /Applications/GitHub.app/Contents/Resources/git/share/git-core/templates/hooks/pre-commit.sample
/usr/local/share/git-core/templates/hooks/pre-applypatch.sample -> /Applications/GitHub.app/Contents/Resources/git/share/git-core/templates/hooks/pre-applypatch.sample
/usr/local/share/git-core/templates/hooks/post-update.sample -> /Applications/GitHub.app/Contents/Resources/git/share/git-core/templates/hooks/post-update.sample
/usr/local/share/git-core/templates/hooks/commit-msg.sample -> /Applications/GitHub.app/Contents/Resources/git/share/git-core/templates/hooks/commit-msg.sample
/usr/local/share/git-core/templates/hooks/applypatch-msg.sample -> /Applications/GitHub.app/Contents/Resources/git/share/git-core/templates/hooks/applypatch-msg.sample
/usr/local/share/git-core/templates/description -> /Applications/GitHub.app/Contents/Resources/git/share/git-core/templates/description
==> Summary
🍺  /usr/local/Cellar/git/1.8.4: 1339 files, 30M, built in 16 seconds

I've tried running: 我试过跑:

brew link git

As well as uninstalling and reinstalling. 以及卸载和重新安装。 My /etc/paths file is currently as follows: 我的/ etc / paths文件目前如下:

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

Any clue? 任何线索? Oh, I also have GitHub's Mac app installed (if that matters?) 哦,我也安装了GitHub的Mac应用程序(如果重要的话?)

It looks like there's a conflict with GitHub's app. 看起来与GitHub的应用程序存在冲突。 I would remove it, you don't need it. 我会删除它,你不需要它。

A few people I spoke with about it said it was kind of buggy and that you're better off just using the terminal (which I agree with). 我与之谈过的一些人说它有点儿车,你最好只使用终端(我同意)。

edit: brew update brew upgrade followed by brew doctor might give more clues. 编辑: brew update brew upgrade后跟brew doctor可能会给出更多线索。

The formula built, but is not symlinked into /usr/local 建立了公式,但没有符号链接到/usr/local

Try overriding the links by: 尝试通过以下方式覆盖链接:

brew link --overwrite git

Add --dry-run to see which files it affects. 添加--dry-run以查看它影响的文件。

If this still fails, try fixing your Homebrew permissions: 如果仍然失败,请尝试修复您的Homebrew权限:

sudo chown -R $USER /usr/local/lib /usr/local/include /usr/local/bin /usr/local/Cellar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM