mac下安装git以及遇到的问题

时间:2024-04-05 09:32:02

安装方法:

http://brew.sh/,先装包管理工具Homebrew,再用brew install git

 

安装完,执行 git 命令,遇到如下错误:

dyld: Library not loaded: /usr/local/opt/gettext/lib/libintl.8.dylib
  Referenced from: /usr/local/bin/git
  Reason: image not found
Abort trap: 6

mac下安装git以及遇到的问题

 

接下来执行 brew install gettext

Warning: git 2.19.1 is already installed and up-to-date
To reinstall 2.19.1, run `brew reinstall git`
Error: Git must be installed and in your PATH!
Warning: gettext 0.19.8.1 is already installed, it's just not linked
You can use `brew link gettext` to link this version.

mac下安装git以及遇到的问题

 

接下来执行 brew link gettext

Warning: gettext is keg-only and must be linked with --force

If you need to have this software first in your PATH instead consider running:
  echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile

mac下安装git以及遇到的问题

 

接下来执行 brew link gettext --force

Linking /usr/local/Cellar/gettext/0.19.8.1... 188 symlinks created

If you need to have this software first in your PATH instead consider running:
  echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile

mac下安装git以及遇到的问题

 

再执行 echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile 

 

最后执行 git 检查一下是否安装成功,有如下输出即可说明安装成功:

mac下安装git以及遇到的问题