271

After upgrading to MacOS X 10.15 Catalina, I cannot run any git commands in my shell:

The default interactive shell is now zsh.

To update your account to use zsh, please run chsh -s /bin/zsh.

For more details, please visit https://support.apple.com/kb/HT208050.

~ | git

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

I thought there's a problem with my shell, so I followed the instructions to change the default Mac OS shell back to bash, using the GUI and also using the command line:

chsh -s /bin/bash

I also restarted the computer. However, I still see the same message, even though echo "$SHELL" outputs /bin/bash.

2
  • What has the shell got to do with anything? This looks like an issue with the Xcode command line tools. Commented Oct 8, 2019 at 6:16
  • 2
    Answered at apple.stackexchange.com/questions/254380/… Commented Oct 8, 2019 at 17:41

1 Answer 1

463

You'll need to reinstall the command line tools:

$ xcode-select --install
Sign up to request clarification or add additional context in comments.

13 Comments

It worked! Also add export BASH_SILENCE_DEPRECATION_WARNING=1 to your ~/.bash_profile file to get rid of the annoying message.
Learn this command by heart. It is almost always the answer to development issues after upgrading macOS.
xcode-select --reset was the solution for my device.
sudo xcode-select --reset worked. However it additionally required to agree to terms and conditions. The command was: sudo xcodebuild -license
It may be possible to dodge the license agreement by running xcodebuild -runFirstLaunch instead of the provided command.
|