1

I'm using subgit to sync my git and SVN repos. I have updated a misleading log message in SVN and I would like that reflected in git. I was wondering if something like this would do the trick:

  • subgit uninstall (on the server to stop the synchronization)
  • git checkout master (on my local)
  • git reset --hard HEAD~5
  • git push -f (to reset the origin git repo back to previous revision)
  • subgit install (to re-sync the SVN changes to git)

Am I on the right lines?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Andy
  • 10,412
  • 13
  • 70
  • 95

1 Answers1

2

You need to retranslate several latest revisions including that one for which you've edited the message. Suppose you've edited message for revision REV and the previous revision

PREV = REV - 1

In this case the following command should help:

subgit install --rebuild-from-revision PREV path/to/git/repository

Note that Git SHA-1 hashes will be changed after that.

The commands you've suggested will result into new SVN revisions without affecting the existing one. In particular git push -f will result into branch/trunk replacement which is not recommended. Prefer --rebuild-from-revision solution.

Dmitry Pavlenko
  • 8,530
  • 3
  • 30
  • 38