Min*_*gyu 196 git macos gitk osx-mountain-lion
有谁知道如何在Mac上安装gitk?
从他们的官方网站来看,似乎gitk带有git,但我的git(git version 1.7.12.4 (Apple Git-37))的版本没有附带gitk.
brew install gitk 不适用于gitk.
版本信息(从评论中复制):
Jen*_*son 262
正确的,1.7.12.4(Apple Git-37)没有附带gitk.您可以使用brew安装gitk附带的更新版本的git.更详尽的说明如下:http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/
在终端上运行以下命令:
brew update
brew install git
Run Code Online (Sandbox Code Playgroud)
如果您收到错误消息表明它无法链接git,那么您可能需要更改它提及的文件的权限/所有者.
完成后,运行:
type -a git
Run Code Online (Sandbox Code Playgroud)
并确保它显示:
/usr/local/bin/git
Run Code Online (Sandbox Code Playgroud)
如果没有,请运行:
brew doctor
Run Code Online (Sandbox Code Playgroud)
并使路径更改为将/ usr/local/bin放在路径的前面.现在,gitk应该在您的路径上(以及更新版本的git).
And*_*zzi 29
从macOS v10.15.6 (Catalina) 开始,我运行:
brew install git
brew install git-gui
Run Code Online (Sandbox Code Playgroud)
这对我有用。
Leo*_*Leo 27
我刚遇到同样的问题,解决方法如下:
alias gitk='/usr/local/git/bin/gitk')ari*_*ris 22
如果你已经通过自制软件安装了git,你可以升级:
$ type -a git
/usr/bin/git
$ brew upgrade git
$ type -a git
/usr/local/bin/git
Run Code Online (Sandbox Code Playgroud)
本地/ bin的那个将有gitk
Abh*_*bhi 16
我遇到过同样的问题.我安装了gitx.
你可以从这里安装gitx.
下载包并安装它.之后打开聚光灯搜索的gitk,转到左上角.单击GitX并启用终端使用.
转到您的仓库并输入:
$ gitx --all
Run Code Online (Sandbox Code Playgroud)
它将打开桂.
用户手册:http: //gitx.frim.nl/user_manual.html
有两种方法可以解决此问题:
四个简单步骤
which git在终端中执行以了解git可执行文件的位置。打开该目录并gitk在bin文件夹中找到。复制路径---通常/usr/local/git/binbash_profile如果尚未创建,请创建。编辑,以在路径中~/.bash_profile添加本地git&的位置gitk。或者,只需复制以下示例中的复制粘贴即可。gitk从/usr/local/bin/gitk文本编辑器中的位置打开文件。lime在文件中找到所有提及的内容,并替换为"#99FF00"。在进行备份之前,请先进行备份。source ~/.bash_profile并运行gitk样品bash_profile:
# enabling gitk
export PATH=/usr/local/git/bin:$PATH
Run Code Online (Sandbox Code Playgroud)
注意 -以下大多数步骤可能需要sudo特权。
brew updatebrew doctorbrew link git/usr/local/Cellar/git/2.4.0/bin到路径,然后重新加载bash并运行gitk which git并观察git是否仍链接到/usr/bin/gitsource ~/.bash_profile