Reputation: 11482
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?
Upvotes: 1
Views: 117
Reputation: 8968
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.
Upvotes: 2