V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
yibin001
V2EX  ›  问与答

mac 10.9.3 上的 git 被我整没了~

  •  
  •   yibin001 · 2014-06-01 10:14:14 +08:00 · 5506 次点击
    这是一个创建于 3828 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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$


    不会弄了,这怎么破?
    4 条回复    2014-06-01 11:15:24 +08:00
    yibin001
        1
    yibin001  
    OP
       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
        2
    JoyNeop  
       2014-06-01 10:31:55 +08:00 via iPad
    重装 Xcode 再重装 GitHub?
    yibin001
        3
    yibin001  
    OP
       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
        4
    66450146  
       2014-06-01 11:15:24 +08:00
    权限错误不是用 disk utility 修复一下就好了么。。。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2871 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 02:51 · PVG 10:51 · LAX 18:51 · JFK 21:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.