Thursday, January 15, 2009

How to install Git and git-svn on Mac OS X

It's hard to find good Google links for installing git-svn on Mac OS X. Here is my piece.

  • Install port: download it at http://darwinports.com and run the installer
  • run sudo port install subversion-perlbindings (it takes a while as the installer download the internet)
  • run sudo port install git-core +svn (don't forget +svn or you will have to uninstall git-core and reinstall it)
You are ready to use git svn command. git-svn does not work but git svn does: that's because git-svn is not in your PATH. If you want to make git-svn work, add /opt/local/libexex/git-core to it (thanks Randall for the tip).

From there, have a look at http://viget.com/extend/effectively-using-git-with-subversion for a quick tutorial.

7 comments:

Randall said...

I used the Git Installer for OS X, but I had the same issue. The "git" command was on the path (e.g. "/usr/local/git/bin"), but "git-svn" and other "git-" commands are in a subdirectory (e.g. "/usr/local/git/libexec/git-core/"). Try adding this to your path.

Ken Liu said...

You don't need to add git-core to the path, just run git-svn by running "git svn".

joet3ch said...

nice save! thanks

Pedro Colunga said...

Nice post! I had already git-core installed and I didn't uninstall it. I just installed "subversion-perlbinding" and later "git-core +svn"...
---> Installing git-core @1.6.6.1_0+doc+svn
---> Deactivating git-core @1.6.6.1_0+doc
---> Activating git-core @1.6.6.1_0+doc+svn
---> Cleaning git-core
And that was all! ;)

Anonymous said...

In my case... the path was: /opt/local/libexec/git-core/git-svn

you may find it by:
$sudo find / -name"git-svn"

Anonymous said...

you don't need to uninstall git first, just re-install using the +svn qualifier. worked for me.

Anonymous said...

Macports is now available at http://www.macports.org/install.php