Archive for March, 2013

Upgrading to new git version on Mac OSX

March 14, 2013 1 comment

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

%d bloggers like this: