Git SVN Error – Fixed

Git-SVN-error-fix

While working on a SVN project using my new favorite tool, “git”, I ran into a small problem. A network bobble caused the subversion portion to fail. I stopped it, but then when I tried again, git said:

Cannot dcommit with a dirty index. Commit your changes firstor stash them with `git stash'.

Some searching found the solution:

$ git checkout $branch

$ git log -g
(look for your last commit, copy the hash for it)

$ git reset --hard $hash

$ git svn rebase

$ git svn dcommit

It worked perfectly, and I can once again use git side-by-side with the unwashed legions of SVN users.

FOLLOW US ON: