I experienced this on MacOS Big Sur but it should apply as well on earlier OS. When you try to run git clone from the terminal you might get this error.
xcrun: error: invalid active developer path
Full error below.
Git for some reason is not preinstalled. It can be installed in variety of ways.
- You can install the Xcode which comes with the command line tools
- Install just the Xcode command line tools
- Download and install the binary from https://git-scm.com/download/mac
- Use homebrew and install git
On this tutorial, we gonna install the Xcode command line tools.
Open the terminal and run
xcode-select --install
After running you would get this prompt. Simply confirm and click Install.
Agree to the terms and the download should start.
Once downloaded go back to the terminal and run the git clone command and you should see the command execute.
If you questions or encounter any issues, please leave a comment below.