How can i make ZSH use the latest git version?
I am using ZSH with oh-my-zsh on OS X.
Today I used hombrew to update to the latest version of git (1.8.something).
However, if I run
➜ ~ git --version git version 126.96.36.199 (Apple Git-33)
I see that still an older version is used. On bash everything works fine and the latest version of git is called.
Since I am new to ZSH, any advice on how to set up ZSH to use the “new” git is appreciated!
3 Solutions collect form web for “How can i make ZSH use the latest git version?”
If the PATH modification didn’t instantly work, you need to realize that with zsh you need to type “rehash” for zsh to recognize there are new executables in the path. Or just log out and back in.
This means that your
$PATH variable isn’t set up to include the right
git (and everything else homebrew installs).
echo $PATH from both bash and zsh. You should see at least one difference: the directory where you installed homebrew, probably
/usr/local/bin. (It’ll either not be in there, or be after
/usr/bin, where the Apple-supplied binary lives.)
To fix it, add a line like
Compare the outputs of
which git (and the outputs of
echo "$PATH") in
The directory containing an up-to-date
git is probably not present in
$PATH variable for
zsh, but it is in
bash. It’s likely caused by
$PATH items being added in your
~/.bash_profile file, which
zsh doesn’t source on startup. If it’s so, add the same assignment to
PATH to your