安装方法:

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以及遇到的问题

 

 

 

相关文章:

  • 2022-12-23
  • 2021-05-15
  • 2021-11-21
  • 2021-08-10
  • 2021-05-21
  • 2021-12-27
  • 2021-09-21
  • 2022-12-23
猜你喜欢
  • 2021-08-28
  • 2021-09-11
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-11-23
  • 2021-07-14
相关资源
相似解决方案