简体   繁体   中英

subgit - how to reflect edited SVN log message in git

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM