Check out this solution:
After upgrading Mac OS X to El Capitan, my local git command no longer worked. When using the git command, the command returns:
xcrun: error: invalid active developer path (/ Library / Developer / CommandLineTools), missing xcrun in: / Library / Developer / CommandLineTools / usr / bin / xcrun
The solution to fix this is to reinstall the command line developer tools using the following command:
xcode-select --install
source share