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

安装方法:

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以及遇到的问题_第1张图片

 

接下来执行 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以及遇到的问题_第2张图片

 

接下来执行 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

 

接下来执行 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

 

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

 

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

Mac下安装git以及遇到的问题_第3张图片

 

 

 

你可能感兴趣的:(Mac下安装git以及遇到的问题)