环境: Mac OSX 10.10。当我尝试使用gitk时,它显示:
Coda-2:~ Coda$ gitk
-bash: gitk: command not found我认为原因是旧版本的git。这里有一些信息,我已经输入了brew update。
Coda-2:~ Coda$ git --version
git version 1.9.3 (Apple Git-50)
Coda-2:~ Coda$ brew install git
Warning: git-2.4.0 already installed, it's just not linked这条消息是什么:it's just not linked?
此外,我检查了git的路径
Coda-2:~ Coda$ which git
/usr/bin/git它应该在/usr/bin/local/git中吗?如何修复它?
更新
我想通了,感谢@TimCastelijns。
brew doctor说:
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
git所以,我输入了:
Coda-2:~ Coda$ brew link git
Linking /usr/local/Cellar/git/2.4.0... 220 symlinks created然后我输入gitk,它起作用了,路径更改为/usr/local/bin/git。但是,当我想要检查git的版本时。它仍然显示旧版本,为什么?
Coda-2:~ Coda$ git --version
git version 1.9.3 (Apple Git-50)发布于 2015-05-14 01:38:28
请按照以下步骤解决此问题:
git --version检查git版本,可能会显示旧版本。使用brew update.更新
brew install git从Homebrew安装最新版本的Git。(请注意,如果安装过程中出现任何错误,可以使用brew doctor命令。在我的例子中,它告诉我使用brew link git.)
我现在可以使用gitk了。
发布于 2020-02-09 03:31:05
我刚刚在macos上通过homebrew安装了最新版本的git。
11:28 $ git --version
git version 2.25.0它似乎没有gitk和git gui,所以我注意到了linux的答案,并尝试通过自制软件安装相同的软件包git-gui,并且成功了。
brew install git-gui找到错误here。
我运行的是macos 10.14.5 Mojave。
发布于 2019-07-02 23:00:42
假设OP使用的是Mac,Linux用户将从Google找到此链接,而被接受的解决方案将无济于事。
在Linux上,使用您最喜欢的包管理器并安装git-gui。
在基于RedHat的系统( CentOS除外)上,执行以下操作:
yum install -y git-gui
它将安装gitk依赖项。
好了。
https://stackoverflow.com/questions/30195143
复制相似问题