简体   繁体   English

subgit-如何在git中反映已编辑的SVN日志消息

[英]subgit - how to reflect edited SVN log message in git

I'm using subgit to sync my git and SVN repos. 我正在使用subgit来同步我的git和SVN仓库。 I have updated a misleading log message in SVN and I would like that reflected in git. 我已经更新了SVN中的误导性日志消息,并且希望在git中反映出来。 I was wondering if something like this would do the trick: 我想知道这样的事情是否可以解决问题:

  • subgit uninstall (on the server to stop the synchronization) subgit uninstall (在服务器上停止同步)
  • git checkout master (on my local) git checkout master (在我本地)
  • git reset --hard HEAD~5
  • git push -f (to reset the origin git repo back to previous revision) git push -f (将原始git repo重置回先前的版本)
  • subgit install (to re-sync the SVN changes to git) subgit install (将SVN更改重新同步到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 假设您已经编辑了修订版REV和先前修订版的消息

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. 请注意,此后将更改Git SHA-1哈希。

The commands you've suggested will result into new SVN revisions without affecting the existing one. 您建议的命令将导致新的SVN修订版,而不会影响现有的修订版。 In particular git push -f will result into branch/trunk replacement which is not recommended. 特别是git push -f将导致分支/主干替换,不建议这样做。 Prefer --rebuild-from-revision solution. 首选--rebuild-from-revision解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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