I installed git-core from MacPorts, but when I ran git-svn I didn't have a "clone" command, which is what all the cool kids are talking about. I'm still not sure that I know precisely why that was the case, but in poking around on the web I found a few places with installation instructions, and eventually things were working, so I'll add what I did to the pool (my main motivation is letting you know the problem I was trying to fix though).
- Followed the instructions from http://www.beyondthetype.com/2007/6/15/guide-to-installing-git-on-a-intel-based-mac to install the latest version of Git from source
- Re-installed subversion using the package from http://downloads.open.collab.net/binaries.html. Why? Because the last step in the previous instructions (setting the PERL5LIB) didn't help, and I couldn't find the svn-perl libraries anywhere. The instructions on http://speirs.org/2007/07/22/getting-git-svn-working-on-the-mac/ were helpful. After the subversion installation I had a directory /usr/local/lib/svn-perl, which did the job.
- Added export PERL5LIB='/usr/local/lib/svn-perl' to my .profile
- Added /usr/local/git-188.8.131.52 to PATH in my ,profile (early on, to make sure git was found here first)
- When I tried git-svn I got an error concerning Term::ReadKey when perl tried to prompt me for a password. I tried to install Term::ReadKey from CPAN interactively (sudo perl -MCPAN -e 'shell'
, then 'install Term::ReadKey', but got "Can't exec "./make": No such file or directory at /System/Library/Perl/5.8.6/CPAN.pm line 4566.". The answer was to change directory to ~/.cpan/build/TermReadKey-2.30 and execute the following commands: sudo perl MakeFile.pl; sudo make; sudo make test; sudo make install. Now I have the Term::ReadKey module installed!
- When I tried to 'gitify' after that, I got this message : "error: More than one value for the key svn-remote.svn.fetch: :refs/remotes/git-svn". This seems to have been caused by previous failed attempts - removing the xxx.git file and running 'gitify' again seemed to work.
For people like me who are less than clear about the result, here's what you get:
- A copy of your project in '../project_name.git'. This is your git working directory.
- Your repository is in .git in the git working directory.
- Change into the git working directory and start doing your stuff
- You'll probably find these commands useful:
- git status : tells you what's uncommitted
- git add : adds a new file to version control. "git add *" seems to do everything you'd want :-)
- git checkout -f : reverts local changes
- git commit -a : commits any modifications (but not new files) to the repository
- git-svn rebase : merge svn changes into your git repository
- git-svn dcommit : commits all your changes back to svn
And if I'd known it was going to be this hard when I started, I wouldn't have.