From svn to git, handling non-standard repo layouts

Posted by Kenneth Kalmer on June 16, 2008

Today I finally had to “extract” a project from one of our biggest repos as part of a git migration plan. I’ve converted most of the other smaller projects in the same repo over using just their trunk, and it has worked without any noticeable issues. Now the project in question has several active branches and important tags. Our repo layout is something to be a shamed of, and git-svn likes “standard” subversion layouts.

I found this thread on KernelTrap, where one user has a similair layout to ours and faced the exact same predicament. The thread is interesting, and the people offer some good tips and advice. Although most of them just seemed “wrong”.

I proceeded to get a copy of our live repo onto my laptop for a simple test. Using a quick svnadmin dump/load combo I had a copy to play with. I sat with a team member, and several svn manipulations later we had restructured that project’s layout to be more svn-like. I then commenced to use the standard git-svn import tool and it pulled in all the branches, tags and trunk for the project in without breaking a sweat.

So, importing from svn with full history from a non-standard repo layout isn’t a daunting task after all.

Just one friendly warning though, if possible, get rid of as many unused branches and tags as possible before importing into git. The full history can get very messy in some cases, and in others a clean slate will be welcomed by the team…

Hope this helps someone else to jump ship easily :)

Cheating Git

Posted by Kenneth Kalmer on April 24, 2008

Nope, its not another post about how incredible git is, instead I’m just gonna highlight a quick way to get used to git and/or git-svn during the transition (yes, resistance is futile).

$ sudo gem install cheat
$ cheat git
$ cheat gitsvn

No need to open a browser, search through delicious or even google.

Hope it helps make git and/or git-svn more digestible.

UPDATE (2008-04-29)

I got beaten to the punch on using cheat, thought I’d just add some more links for your enjoyment

Git and Ruby on RubyInside
Printable Git Cheat Sheet (scarily similar to the Mercurial ones)

  • Tags

    activerecord air amqp analytics audits bash bind capistrano cheat convert couchdb daemon-kit dlz dns elsewhere gentoo gist git hoptoad linux macros mercurial messaging mysql nginx olympics plugins postfix postini powerdns presentations projects quickies rails rake review ruby ruby19 ruote security shoes sitemap ssl svn webby
  • Recent Posts

  • Archives

  • Alltop. Seriously?! I got in?