在 svn 中,我可以恢复更改并将其搁置以供以后使用吗?

发布于 2024-07-18 18:30:15 字数 130 浏览 7 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

翻身的咸鱼 2024-07-25 18:30:15

假设你得到了一个干净的向后合并,你可以这样做......

svn merge -r 745:744 <source>

然后当你想重新应用它时,你可以将它向前合并回来:

svn merge --ignore-ancestry -r 744:745 <source>

有关更多信息,请查看“合并的常见用例。"

Supposing you get a clean backwards merge, you could do this...

svn merge -r 745:744 <source>

Then when you want to re-apply it, you could forward merge it back in:

svn merge --ignore-ancestry -r 744:745 <source>

For more info, check out the "Common Use-Cases for Merging."

早乙女 2024-07-25 18:30:15

是的,这绝对是可能的。

当您恢复更改时,它仍然会在存储库中创建新的修订版本。 因此,您可以执行以下操作:

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文