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
接下來執行 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.
接下來執行 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 檢查一下是否安裝成功,有如下輸出即可說明安裝成功: