Over the weekend I had to send some changes to an SVN repo. Thing is that I use git-svn to have all those XXI century benefits like local commits.
Sadly I had some problems with git-svn, concretely it failed half the way through sending my really big number of changes. The result was that I was left with uncommitted changes and missing commits after such set of changes. No need to say that I was really nervous about the state of my hard work of the week…
So after some desperate google searches and some questions to my personal GIT expert, desrt, I found this mail in google groups. I reproduce the process here:
How to save your neck when git-svn dcommit fails half through the process
- Open
.git/logs/HEAD - Look for your most recent commit (note that these commits are sorted by “unix time”, although you can also find the latest one by reading the shortlog there
- Confirm that the commit you found is the right one: git show
git reset --hard hash from loggit svn rebasegit svn dcommit
This picks up where it left off, so you won’t loose anything, happy happy happy git
.
Hope this saved your neck like it saved mine. Other tips welcome
!
Update: Mike lets me know that the commands were bad written because of html entities and stuff, fixed now.






