在 svn 中,我可以恢复更改并将其搁置以供以后使用吗?
我在 svn 存储库中提交了一些更改。 假设 HEAD 位于 r750,我想在不丢失 r746-r750 的情况下恢复 r745。 这可能吗?
而且,我可以以某种方式保存 r745 并稍后重新应用它(作为新修订版)吗?
I have some changes commited a few commits back in my svn repository. Let's say HEAD is at r750 and I want to revert r745 without losing r746-r750. Is this possible?
And, can I somehow save r745 and reapply it later (as a new revision)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设你得到了一个干净的向后合并,你可以这样做......
然后当你想重新应用它时,你可以将它向前合并回来:
有关更多信息,请查看“合并的常见用例。"
Supposing you get a clean backwards merge, you could do this...
Then when you want to re-apply it, you could forward merge it back in:
For more info, check out the "Common Use-Cases for Merging."
是的,这绝对是可能的。
当您恢复更改时,它仍然会在存储库中创建新的修订版本。 因此,您可以执行以下操作:
1) 查看当前副本 r750。
2) 使用 svn merge -r 指定工作副本上的还原。 您的工作副本将合并旧版本。
3) 将工作副本签入为 r751。
现在您将在历史记录中进行两次修订。 新的(r751)不包括r745,因为你将其回滚了。 但如果你想重新应用它,r745 仍然会在那里。 您可以简单地签出 r745 的副本,将其合并到您的工作副本中,然后重新签入(例如 r752)。
Yes, this is definitely possible.
When you revert a change, it still creates a new revision in the repository. So you would do something like this:
1) Check out current copy r750.
2) Specify a revert on the working copy using
svn merge -r
. Your working copy will have the old version merged in.3) Check in the working copy as r751.
Now you'll have two revisions in the history. The new one (r751) which does not include r745, since you rolled it back. But r745 will still be there if you ever want to reapply it. You can simply check out a copy of r745, merge it into your working copy, and check it back in (say as r752).