I tried to update Git on Mac terminal by using Homebrew (brew
) and everything looked good except the directory was different in the terminal. Command "which git" gives me /opt/homebrew/bin/git, and the version is 2.34.
But in Visual Studio Code it says /usr/bin/git. Here the version is 2.30.
How I can solve this problem?
Check if the setting "
Git Path
" was set directly to/usr/bin/git
.If so, you can delete that setting: VSCode will pick up
git
from the$PATH
.As long as which git displays
/opt/homebrew/bin/git
before/usr/bin/git
, you will be OK.The OP MadCodex adds in the comments:
I would not recommend that "solution", as the brew git is the one which is supposed to be here.
From the discussion, adding
export PATH="/opt/homebrew/bin:$PATH"
in~/.zshr
and relaunching VSCode was enough.