fixing a bad commit with git-svn

Posted by jacqui maher on March 25, 2008 at 05:28 PM

I do this fairly often, mostly because I haven’t migrated all of our svn pre-commit hooks to git. I really ought to do that..

$ git tag bad 012345 # or any other valid git reference
$ git checkout bad
$ # make changes here and update the index
$ git add
$ git commit –amend
$ git rebase –onto HEAD bad master # where ‘master’ is the branch in question
$ git tag -d bad

thanks to sebastian delmont for this.

Tags: git, svn
Hierarchy: previous, next

Comments

There are 3 comments on this post. Post yours →

You forgot to mention interactive rebasing:

$ git rebase –interactive 012345^ # the ^ is to get one revision before the one with problems

# edit the list of revisions

# for each revision to be edited, perform changes and then:

$ git rebase –continue

Jacqui,

I would like to speak with you about an Agile/Ruby on Rails project with a luxury retailer in NYC. They are looking for someone 6-12 mos. Please let me know if you are interested. You can reach me on my direct dial 212-204-1025. There are two roles. If you know anyone who might be interested as well, I would love to speak with them too! I look forward to hearing from you.

Cheers,

Ben Ross
IT Practice
Forrest Solutions
212-204-1025

jennifer Lindner

very helpful, as was sebastian’s comment about editing list and continuing one change at a time.

Post a comment

Required fields in bold.