HOWTO Recover from a bad git-svn dcommit when something barfs

Showing 1-1 of 1 messages
HOWTO Recover from a bad git-svn dcommit when something barfs davetron5000 9/17/08 6:28 AM
I just did a an import from my git repo as per
http://code.google.com/p/support/wiki/ImportingFromGit and it was
quite painful.  All steps complete normally, save for the final git-
svn dcommit

It goes along and gets either the "Bad Gateway", or a seg fault, or a
bus error.  This leaves the working dir in a weird state where you
pretty much can't continue and can't do anything.  I use git-svn all
the time for work and this never happens, so it seems like a problem
on Google's end and hopefully they are watching.

How To Recover:

First, open .git/logs/HEAD

Find the hash of the commit that's the head of your git repo.
Hopefully you remember the commit message and can figure it out, but
it should be pretty obvious

Back in your now f-ed up working-dir:

git reset --hard <hash from log>

This gets your working dir back to where it was before you did a git-
svn dcommit.  Then:

git-svn rebase
git-svn dcommit

This will likely fail again and you'll have to repeat the entire
process.  My repo had 60 or so commits, and I had to repeat the "reset
--hard, rebase, dcommit" process several times before it finally
finished.  The good news is that it DOES pick up where it left off, so
you will eventually  complete the import.

Hope this helps someone.

Version info:

OS X 10.5.4
git 1.5.4.5
svn 1.4.4

Dave