SVN:如何修复错误地提交到主干而不是分支?
我最近在 SVN 存储库中创建了一个维护/错误修复分支,以便在我们将在主干上引入新功能的同时发布稳定的版本。这个分支被称为“4.2.x”
现在,团队的一位开发人员没有将他的工作副本切换到 4.2.x 分支,而是向主干提交了更改。这些更改应与其他错误修复和小更改一起包含在 4.2.x 分支中,并在下一个 4.2 版本中交付给客户。
这些更改包含在一系列连续修订中,例如 500 到 510,并且它们是对主干所做的最新提交。
将这些更改带回 4.2.x 分支并从主干中移出的最佳和最干净的方法是什么,这样当我们想要将 4.2.x 分支合并到主干时,就不会造成问题?
I recently created a maintenance/bug-fix branch in our SVN repository, in order to make stable releases while we will introduce new features on the trunk. This branch is called "4.2.x"
Now, one developper of the team didn't switch his working copy to the 4.2.x branch and commited changes to the trunk. These changes should be in the 4.2.x branch along with other bug fixes and small changes, to be shipped to the customer in the next 4.2 release.
These changes are comprised in a bunch of consecutive revisions, say 500 to 510, and they are the latest commits made to the trunk.
What is the best and cleanest way to bring these changes back to 4.2.x branch, and out of the trunk, in a way that won't cause problems later when we want to merge the 4.2.x branch to the trunk ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
将修订版 500 到 510 从主干合并到分支,并提交分支。
由于这些是错误修复,它们通常也应该在主干中完成,所以我会按原样保留主干。如果您确实想从主干中删除它们,则 撤消这些更改。
为了避免将这些更改从分支合并回主干,请使用“仅记录”选项将提交从分支合并到主干。
Merge revisions 500 to 510 from trunk to branch, and commit the branch.
Since these are bug fixes, they should normally also be done in the trunk, so I would leave the trunk as is. If you really want to remove them from the trunk, then undo these changes.
To avoid merging back those changes from the branch to the trunk, merge the commit from the branch to the trunk with the option "record only".
您应该能够在单独的项目中为这些修订创建存储库的副本,然后对它们进行分支。完成后,您可以将主干恢复到进行这些更改之前。并且先做好备份。
You should be able to create a copy of the repository for those revisions in a separate project, then branch these. Once that's done, you can then revert the trunk back before these changes were made. And make a backup first.
只需恢复修订版 500-510 中的更改就可以了。
Just revert changes from revisions 500-510 and you should be fine.