mac 10.9.3 上的 git 被我整没了~

2014-06-01 10:14:14 +08:00
 yibin001
Yibins-MacBook-Pro:~ yibin$ which git
/usr/bin/git
Yibins-MacBook-Pro:~ yibin$ /usr/bin/git --version
git version 1.8.5.2 (Apple Git-48)
Yibins-MacBook-Pro:~ yibin$ brew install git
Warning: git-1.9.3 already installed, it's just not linked
Yibins-MacBook-Pro:~ yibin$ brew link git
Linking /usr/local/Cellar/git/1.9.3...
Error: Could not symlink share/git-core/templates/info/exclude
Target /usr/local/share/git-core/templates/info/exclude
already exists. You may want to remove it:
rm /usr/local/share/git-core/templates/info/exclude

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
Yibins-MacBook-Pro:~ yibin$ rm /usr/local/share/git-core/templates/info/exclude
rm: /usr/local/share/git-core/templates/info/exclude: Permission denied
Yibins-MacBook-Pro:~ yibin$ brew link --overwrite git
Linking /usr/local/Cellar/git/1.9.3...


Error: Could not symlink share/git-core/templates/info/exclude
/usr/local/share/git-core/templates/info is not writable.

Yibins-MacBook-Pro:~ yibin$ git
-bash: /usr/local/bin/git: No such file or directory
Yibins-MacBook-Pro:~ yibin$


不会弄了,这怎么破?
5496 次点击
所在节点    问与答
4 条回复
yibin001
2014-06-01 10:16:39 +08:00
重新安装也不行~


ibins-MacBook-Pro:~ yibin$ brew install git
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/git-1.9.3.m
Already downloaded: /Library/Caches/Homebrew/git-1.9.3.mavericks.bottle.tar.gz
==> Pouring git-1.9.3.mavericks.bottle.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
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
/usr/local/lib/perl5/site_perl/Git.pm -> /Applications/GitHub.app/Contents/Resources/git/lib/perl5/site_perl/Git.pm
/usr/local/lib/perl5/site_perl/Git/SVN.pm -> /Applications/GitHub.app/Contents/Resources/git/lib/perl5/site_perl/Git/SVN.pm
/usr/local/lib/perl5/site_perl/Git/SVN/Utils.pm -> /Applications/GitHub.app/Contents/Resources/git/lib/perl5/site_perl/Git/SVN/Utils.pm
/usr/local/lib/perl5/site_perl/Git/SVN/Ra.pm -> /Applications/GitHub.app/Contents/Resources/git/lib/perl5/site_perl/Git/SVN/Ra.pm
/usr/local/lib/perl5/site_perl/Git/SVN/Prompt.pm -> /Applications/GitHub.app/Contents/Resources/git/lib/perl5/site_perl/Git/SVN/Prompt.pm
/usr/local/lib/perl5/site_perl/Git/SVN/Migration.pm -> /Applications/GitHub.app/Contents/Resources/git/lib/perl5/site_perl/Git/SVN/Migration.pm
/usr/local/lib/perl5/site_perl/Git/SVN/Memoize/YAML.pm -> /Applications/GitHub.app/Contents/Resources/git/lib/perl5/site_perl/Git/SVN/Memoize/YAML.pm
/usr/local/lib/perl5/site_perl/Git/SVN/Log.pm -> /Applications/GitHub.app/Contents/Resources/git/lib/perl5/site_perl/Git/SVN/Log.pm
/usr/local/lib/perl5/site_perl/Git/SVN/GlobSpec.pm -> /Applications/GitHub.app/Contents/Resources/git/lib/perl5/site_perl/Git/SVN/GlobSpec.pm
/usr/local/lib/perl5/site_perl/Git/SVN/Fetcher.pm -> /Applications/GitHub.app/Contents/Resources/git/lib/perl5/site_perl/Git/SVN/Fetcher.pm
/usr/local/lib/perl5/site_perl/Git/SVN/Editor.pm -> /Applications/GitHub.app/Contents/Resources/git/lib/perl5/site_perl/Git/SVN/Editor.pm
/usr/local/lib/perl5/site_perl/Git/IndexInfo.pm -> /Applications/GitHub.app/Contents/Resources/git/lib/perl5/site_perl/Git/IndexInfo.pm
/usr/local/lib/perl5/site_perl/Git/I18N.pm -> /Applications/GitHub.app/Contents/Resources/git/lib/perl5/site_perl/Git/I18N.pm
Error: Permission denied - /usr/local/lib/perl5/site_perl/5.16.2
Yibins-MacBook-Pro:~ yibin$
JoyNeop
2014-06-01 10:31:55 +08:00
重装 Xcode 再重装 GitHub?
yibin001
2014-06-01 10:37:10 +08:00
@JoyNeop
先从xode中重新安装了一份。
brew install git #此时版本1.9.3
brew link git
还是出现上面的很多权限错误,无奈只得一个一个的chmod,终于。。。

Yibins-MacBook-Pro:~ yibin$ brew link --overwrite gitLinking /usr/local/Cellar/git/1.9.3... 208 symlinks created

OK了。

Yibins-MacBook-Pro:~ yibin$ git --version
git version 1.9.3

内牛满面
66450146
2014-06-01 11:15:24 +08:00
权限错误不是用 disk utility 修复一下就好了么。。。。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/115273

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX