gitify command below.
All my client projects are hosted on Subversion repos. All my OSS projects are hosted on Rubyforge Subversion repos.
And tomorrow I head off for the 2nd “no internet” RailsCamp megafest, being held outside of Melbourne. From what I heard about the 1st one, it involved a lot of Guitar Hero II and beer. This weekend I’m promised that someone is bringing a Wii – dear God I do love the tennis game.
Like MacDonalds burgers and Veganism, if there are two things that don’t go together its Subversion and “No Internet”.
Fortunately, for all RailsCampers, there is a solution to your fears that you won’t be able to hack on your favourite project, and will be forced into playing Guitar Hero II/III and/or the Wii for the whole weekend.
Specifically, the git-svn command.
More specifically, follow the following steps:
git-svn clone <your svn url> projectname.git
- Go camping for the weekend.
- Commit changes with
git commit -a -m "hahaha I'm camping and working - doh!"
- Come home from camping.
git-svn rebaseto re-import any SVN changes that might have been committed whilst you were away. If there are conflicts, just follow the instructions.
git-svn dcommitand your svn repository will be updated with all your fancy changes; no one will ever know you used Git.
I remember having problems getting
git-svn to run because the default path to the perl cmd is crap, and you need to specify
PERL_PATH='/usr/bin/env perl', I think, before installation.
For MacPorts etc, its
sudo port install git-core. I think the reason its not just called ‘git’ is to remind you that you know nothing about git. Which is fair. You don’t if you don’t know how to install it, I guess.
From source, get the tarball from the home page.
For Windows, use cygwin.
Want a utility cmd to create a Git repo in the parent folder of a Subversion project? That is, go to your Rails app that is checked out from a Subversion repo, and run
gitify, and you will have a
foldername.git folder in the parent folder.
Stick this code into ~/bin/gitify and add ~/bin to your path: