有问题,安装git与自制。尝试了过去所有可用的解决方案。我确实有/usr/local的写权限。我可以在没有问题的情况下进行brew更新和brew医生,但是它说我已经安装了git-git (不管是什么)。我有-我的蛋壳。如果相关的话,我已经安装了带有git和atom的xcode。
Last login: Tue Feb 24 09:56:18 on console
You have new mail.
# user at mymac in ~ [9:57:48]
$ brew install git
Error: git-git already installed
To install this version, first `brew unlink git'
# user at mymac in ~ [9:57:54]
$ brew unlink git
Error: No such keg: /usr/local/Cellar/git
# user at mymac in ~ [9:58:04]
$ brew update
Updated Homebrew from b33e8a75 to cf5325ac.
==> New Formulae
deisctl gcovr pdf-redact-tools
==> Updated Formulae
activemq couchdb-lucene hamsterdb libgadu redpen
avian datomic httpie libmpdclient unittest
berkeley-db gtk-gnutella ice mysql
cctools h2o ipsumdump mysql-cluster
# user at mymac in ~ [10:01:04]
$ brew doctor
Your system is ready to brew.
# user at mymac in ~ [10:01:25]
$ brew install git
Error: git-git already installed
To install this version, first `brew unlink git'
# user at mymac in ~ [10:01:30]
$ brew unlink git
Error: No such keg: /usr/local/Cellar/git
# user at mymac in ~ [10:01:35]
$ brew link git
Error: No such keg: /usr/local/Cellar/git
# user at mymac in ~ [10:01:44]
$ git --version
zsh: command not found: git
# user at mymac in ~ [10:02:01]
$ brew --version
0.9.5
# user at mymac in ~ [10:06:17]
$ git-git --version
zsh: command not found: git-git
# user at mymac in ~ [10:11:32]
$ which git-git
git-git not found更新:--我尝试将更改为bash。同样的问题。
mymac:~ user$ git --version
-bash: git: command not found
mymac:~ user$ brew install git
Error: git-git already installed To install this version, first `brew unlink git'
mymac:~ user$ –忘了说我用的是约塞米蒂10.10.2
发布于 2016-07-05 08:12:55
从命令行执行
where git你可能会得到两个地点
/usr/bin/git
/usr/local/bin/git那就去做
/usr/bin/git --version你应该去
git version 2.5.4 (Apple Git-61)这是Mac附带的安装版本。
然后检查此路径上的版本。
/usr/local/bin/git --version
git version 2.7.1这是当前的版本
然后检查你的路径
echo $PATH并确保'/usr/local/bin/‘在您的路径的早期,否则它将不会执行git命令,如果不编辑您的路径。
https://stackoverflow.com/questions/28699273
复制相似问题