gitk:找不到命令 [英] gitk: command not found
问题描述
环境:Mac OSX 10.10。当我尝试使用 gitk
时,它显示:
Coda- 2:〜Coda $ gitk
-bash:gitk:command not found
我认为原因是旧版本的 git
。这是一些信息,我已经输入了 brew update
。
Coda-2:〜Coda $ git --version
git版本1.9.3(Apple Git-50)
Coda-2:〜Coda $ brew install git
警告:git-2.4。 0已经安装,它只是没有链接
这是什么信息:它只是没有链接
?
此外,我检查 git
的路径:
Coda-2:〜Coda $哪个git
/ usr / bin / git
它应该在 / usr / bin / local / git
中?如何解决它?
更新
我想通了,谢谢@TimCastelijns。
brew doctor
表示:
警告:您的酒窖中存在未连接的酒桶
将酒桶断开可能会导致酝酿麻烦,并导致酿酒依赖于
这些酒桶一旦建成就无法正常运行。对这些运行`brew link`:
git
:
Coda-2:〜Coda $ brew link git
链接/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)
请检查 git
版本。
输入 git --version
,并可能显示旧版本。
接下来,更新您的 Homebrew
键入 brew update
。
brew install git
请注意,如果显示警告:git-2.4.0已经安装,它没有链接
我们可以检查 brew doctor
,在我的它告诉我使用 brew link git
最后,输入 brew install git
并重新启动终端。
我可以使用 gitk
并将git版本升级到最新版本。
$由于
gitx
不再支持 OSX 10.12 b
,我建议使用 Gitx-dev Environment: Mac OSX 10.10. When I was trying to use gitk
, it shows:
Coda-2:~ Coda$ gitk
-bash: gitk: command not found
I think the reason is the old version of git
. Here is some information, and I have already typed 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
What is this message: it's just not linked
?
Furthermore, I check the path of git
:
Coda-2:~ Coda$ which git
/usr/bin/git
It should be in /usr/bin/local/git
? How to fix it?
UPDATE
I figure it out, thank @TimCastelijns.
brew doctor
said:
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
So, I typed:
Coda-2:~ Coda$ brew link git
Linking /usr/local/Cellar/git/2.4.0... 220 symlinks created
Then I typed gitk
, and it worked and the path changed to /usr/local/bin/git
. However, when I want to check the version of git
. It still showed the old version, why?
Coda-2:~ Coda$ git --version
git version 1.9.3 (Apple Git-50)
First, check git
version.
Type git --version
, and it may show old version.
Next, update your Homebrew
Type brew update
.
Then, download the latest version. brew install git
Note that, if it show Warning: git-2.4.0 already installed, it's just not linked
We can check brew doctor
, in my case, it told me to use brew link git
Finally, type brew install git
again and restart terminal.
I can use gitk
and upgrade git version to the latest version.
Update
Since gitx
is no longer supported for OSX 10.12
, I recommend using Gitx-dev
这篇关于gitk:找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!