I ran into this error trying to push to git, when I typed git init.
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools
You can select command line tools from the XCode Preferences shown in the screenshot below.
You will be prompted for password.