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).

  • How do I find the next commit in git?
  • git rebase -i for specific commits?
  • Change name of folder when cloning from github?
  • git clone -b tag results in - warning: Remote branch not found in upstream origin, using HEAD instead
  • Create Git patches for two files across several renames
  • How to git fetch by branch creator from stash
  • However, if I run

    ➜  ~  git --version
    git version (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!



  • Is there a reason why you shouldn't mix ssh and smart http access with git?
  • merge git projects without common commit
  • Git “NO-HEAD” statement
  • How to revert uncommited changes to a files of certain type in git
  • “'git' is not recognized as an internal” blah blah even though the command works the first time
  • How to create git workflow on heroku?
  • 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).

    Try doing 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

    export PATH=/usr/local/bin:$PATH

    to your ~/.zshenv.

    Compare the outputs of which git (and the outputs of echo "$PATH") in bash and zsh.

    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 ~/.bashrc and/or ~/.bash_profile file, which zsh doesn’t source on startup. If it’s so, add the same assignment to PATH to your ~/.zshrc

    Git Baby is a git and github fan, let's start git clone.