Command Line Tools bash (git) not working - macOS Sierra final release candidate

I have just upgraded from OS X 10.11 "El Capitan" to 10.12: "Sierra", and when I try to access git commands inside a terminal, I get the following error:

xcrun: error: invalid active developer path

(/Library/Developer/CommandLineTools), missing xcrun at:

/Library/Developer/CommandLineTools/usr/bin/xcrun

Please help me if anyone have solution.


Re-install Xcode developer tools

xcode-select --install

I fixed this issue by downloading and installing the 'Command Line Tools (macOS sierra) for Xcode 8' package from Apple Developer Downloads.

Be sure to select Command Line Tools (macOS 10.12) for Xcode 8 and not the one for 8.1 beta unless you have Xcode 8.1 beta installed.


I just recently upgraded to macOS High Sierra Version 10.13.3 and has existing xcode. My git command lines have the same issue. "$xcode-select --install" works perfectly for me.