Home > Technology, Troubleshoot, Tutorial > Upgrading to new git version on Mac OSX

Upgrading to new git version on Mac OSX

Mac OSX comes with git pre-installed. You can find the installation here: /usr/bin.

To check its version, type the following:

$ git --version


To upgrade to the latest version of git, do the following:

  1. Download and install latest git from http://git-scm.com. This will install it in /usr/local/git folder. Make sure it did that.
  2. Open terminal and run the following
    $ vi ~/.bash_profile

  3. Go to insert mode (press "i" on your keyboard)
  4. Paste the following
    export PATH=/usr/local/git/bin:$PATH

  5. If there already stuff in .bash_profile file, just append "/usr/local/git/bin" appropriately. For example, in my case, the android sdk path was already set in it. So it was appended at the end as shown below:
    export PATH=/Users/sukamat/android-dev/sdk/platform-tools:/Users/sukamat/android-dev/sdk/tools:/usr/local/git/bin:$PATH

  6. Save the file.
  7. Quit terminal
  8. Reopen terminal
  9. Type the following:
    $ git --version

It should show the version you installed.

  1. March 29, 2013 at 4:02 PM

    That is very attention-grabbing, You’re a very professional blogger. I have joined your rss feed and sit up for in search of extra of your fantastic post. Also, I have shared your website in my social networks!

  1. No trackbacks yet.

Leave a comment