How to do upgrade Git in Mac OS X?

upgrade git in mac os xGit SCM does not comes out-of-the-box(OOTB) with Mac OS X.  However if you have installed Xcode  command line tools or standalone Git Installer then you will have Git SCM on Mac OS X.

Warm Up!

Let’s check existing Git version on your machine.

Scenario 1: You will get similar to this version!


Scenario 2: you may get like this

If you get below message nothing to worry; it means you have not yet installed Git SCM on your machine

Let’s start Git upgrade

First thing, get the latest Git SCM for Mac OS X Click here to Download(from  You will get .dmg file.  In this article I’m using current latest version of Git SCM for upgrade!

  • Open the downloaded git-x.x.x.x-intel-universal-snow-leopard.dmg
  • You will see, Run this shell script (if you have scenario 2 on your machine, skip this step)
  • Run the git-x.x.x.x-intel-universal-snow-leopard.pkg installer and follow the installer instruction
    • This installs the Git in /usr/local/git (root access is required)

Once you finished the package execution (after, click of ‘Finish‘ button)

Git Upgrade Verification

Restart your bash session.  If you wish to preserve your precious screen session, just execute source /etc/profile.  Verifying Git version

Wow, you successfully completed upgrade Git in Mac OS X :)

How to handle if I still getting Git old version displayed on my Terminal.  I know it may happen, don’t worry I will explain.  Follow below instructions.

Adding PATH variable to .bash_profile; open up

Place the below export statement at the end of .bash_profile

Save your modified .bash_profile and close the vim editor.  Either close and re-open your Terminal or execute below command

Now verify Git version and you’re good to go :)

Git for Non-terminal programs (Optional Step/Instruction for you)

Typically Non-terminal programs don’t inherit the system wide PATH and  MANPATH variables that your terminal does.  If you’d like them to be able to see latest Git for any reason.

Run this shell ‘setup git PATH for non-terminal’ from the downloaded .dmg installer

Above script will add the PATH and MANPATH to your ~/.MacOSX/environment.plist file.

You’ll need to log out of your user account for that to take effect.

  • Ben

    I’m running OS X Snow Leopard 10.7.5

    ~$ which git


    ~$ git –version

    git version

    It looks like git is installed and as it should be since I’ve used it for the last year. According to scenario 1, I need to uninstall git and run the script So I did…

    ~$ sh

    Git doesn’t appear to be installed via this installer. Aborting

    How else can I uninstall and reinstall git? Is there something I’m missing?

    Thanks for the article!

    • Hello Ben – You’re welcome.
      As per your comment, its a scenario one.

      • After execution of, restart the terminal
      • Issue a command ‘git –version’, As I mentioned in section ‘Git Upgrade Verification’ if you still get old version of git no issues
      • Proceed with Git installer, complete it
      • After the installation, directory ‘git’ should be present at this path ‘/usr/local/git’
      • Follow the instructions of section ‘Git Upgrade Verification’ in the article for setting up PATH variable
      • Restart the Terminal, Now you should be at latest version of Git

      Please let me know!


      • Terseer Shaguy

        Great Jeeva, worked . Many thanks God bless you loads.Amen

  • mem

    Jeeva, absolutely brilliant and clean. Nothing to add. 5 stars post!



  • LittleHoopoe

    git –version
    git version (Apple Git-48)

    Git doesn’t appear to be installed via this installer. Aborting

    why the uninstaller say that, if git ist already installed?

    • @disqus_siBERhRJpW:disqus It happens sometimes, may not do its job. Nothing to worry! Proceed with remaining steps, “PATH” settings will ensure; newly installed Git is active for you.

      Try it let me know.


      • LittleHoopoe

        thanks for your reply! the rest works fine, I just was irritated of the message. thank you for your help!