I recently upgraded my OS and ran into this error when I tried any git operation on my macbook.
$ git pullxcrun: error: invalid active developer path (/Library/Developer/CommandLineTools),missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
After doing some research, I found the fix is pretty straight forward. Install the Xcode toolkit! Even if you had it installed before, you might have to re-register it or update it to the latest version.
$ xcode-select --install
If that doesn’t work, force it to reset. You’ll need sudo access for this one.
$ sudo xcode-select --reset
If that fails, go to the Appledeveloper download sectionand download Xcode manually.