一、通過homebrew查看是否有異常(首先你得安裝了Homebrew)
$ brew doctor
二、根據提示修改zsh配置
Warning: Homebrew's sbin was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting the PATH for example like so:
echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc
三、實際操作
$ vim ~/.zshrc
將 export PATH="/usr/local/sbin:$PATH 添加到配置文件中
$ source ~/.zshrc
$ which git
$ git --version
四、如果還是不行只需要手動下載git-gui即可
$ brew install git-gui