I ran into this error trying to push to git, when I typed git init.
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools
This is all you need to do:
$ xcode-select --install