error: unable to find utility "git", not a developer tool or in PATH

wenyc picture wenyc · Jun 6, 2016 · Viewed 19k times · Source

I have updated Xcode version to 7.3.1.when I use 'git status',I find an error! as follow:

$git status
sh: line 1:  1601 Segmentation fault: 11  /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find git 2> /dev/null
git: error: unable to find utility "git", not a developer tool or in PATH

Thank you advanced!

Answer

Gedas Kutka picture Gedas Kutka · Feb 12, 2018

This happened to me also with upgrading to High Sierra and XCode to 9. This sequence has fixed it.

xcode-select --install
sudo xcode-select -s /Library/Developer/CommandLineTools

Found this answer on https://davidwalsh.name/fix-git-high-sierra-upgrade (article and comments.)