I ran into this error trying to push to git, when I typed git init.
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools
Try:
sudo xcode-select -r
in this way it unsets any user-specified developer directory, so that the developer directory will be found via the default search mechanism.