再Mac中如何使用Homebrew安装git以及gitk

如何使用Homebrew安装git

$ brew install git

查看已安装的git

$ type -a git

git is /usr/local/bin/git
git is /usr/bin/git

如果使用中查看git版本如下,说明使用的git是apple自带的git。

$ git --version
git version 1.7.10.2 (Apple Git-33)

在文件~/.bash_profile中加入 export PATH="/usr/local/bin:${PATH}"
然后执行

$ source ~/.bash_profile

如何使用Homebrew安装gitk

如何安装可是化工具gitk?

$ brew update
$ brew install git-gui

如何使用gitk?只需要在git项目所在目录,敲下如下命令即可。

$ gitk

参考:
How to use the Homebrew installed git on Mac? https://apple.stackexchange.com/questions/93002/how-to-use-the-homebrew-installed-git-on-mac

How to install Gitk for macOS https://www.geekbitzone.com/posts/git/gitk-for-macos/

你可能感兴趣的:(git)