This seems to be a recurring issue after every major OS update. You need to reinstall XCode and the Command Line Tools to get them working again.
Trying a ‘git status’ after upgrading to Ventura over the weekend, I get this error:
> git status xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
To fix this you need to reinstall the XCode Command Line Tools (described here) with:
xcode-select --install
Press Install when prompted:
![](https://i0.wp.com/www.kevinhooke.com/wp-content/uploads/2022/10/image-1.png?resize=525%2C281&ssl=1)
After the install completes, restart your Terminal and you should be good to go.