found

One day, I opened VSCode as usual, and suddenly gitlens popped up saying that it was not available. Accordingly, Git was not available either.

When you use git in iterm, the error is as follows

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
panghongrui@panghongruideMacBook-Pro ~ % xcode-select --install
xcode-select: note: install requested for command line developer tools

Copy the code

To solve

Git suddenly has problems, and I think the reason is that there was a macOS security update last night

The solution is as follows

xcode-select –install

Using this command to solve the problem, we found that Git can be used

But it’s not completely solved, our Gitlens still doesn’t work, so one thing I want to focus on here is vsCode’s settings.json. I don’t know if you’ve noticed this before, but let me just briefly say that it’s actually a set of Settings for VSCode. We set vscode, and it’s actually this json that works, so it’s clear what the solution is.

"git.enabled": true,
"git.path": "/usr/bin/git"
Copy the code

If you are not sure about the git path, you can use the “which git” command to check it. Don’t forget to restart vscode

conclusion

Solve problems in a timely manner and have some understanding of settings.json