如何撤消合并(不提交)?
我刚刚做了一个 svn merge 将更改从主干合并到分支:
$ svn merge -r328:HEAD file:///home/user/svn/repos/proj/trunk .
--- Merging r388 through r500 into '.':
A foo
A bar
C baz1
C baz2
U duh
[...]
但是冲突太多,所以我想撤消它。
一种方法是提交然后合并回来。但由于冲突,我无法承诺。在这种情况下撤消的最佳方法是什么?
I just did an svn merge
to merge changes from the trunk to a branch:
$ svn merge -r328:HEAD file:///home/user/svn/repos/proj/trunk .
--- Merging r388 through r500 into '.':
A foo
A bar
C baz1
C baz2
U duh
[...]
But there were too many conflicts, so I'd like to undo that.
One way to do that is to commit and then merge back. But I can't commit because of the conflicts. What's the best way to undo in that case?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
从工作副本的顶部递归恢复:
svn revert -R。
您将需要手动删除已添加的文件。与恢复后一样,添加的文件将保留在磁盘上,但它们将处于非跟踪状态(“?foo”)
Revert recursively from the top of your working copy:
svn revert -R .
You will need to manually delete the files that were added. As in after reverting, the files added will remain on disk but they will be in a non-tracked state ("? foo")
只要您尚未提交,您就可以随时进行恢复以撤消所有更改。
As long as you haven't commited, you can always do a revert to undo all your changes.
我面临着同样的情况,而且我还有一些我不想失去的其他变化。
因此,对于冲突的项目,不需要完全递归恢复,而只需
svn revert
对我来说是有好处的I faced the same situation, also I had some other changes which I didn't wanted to lose.
So, instead of full recursive revert just
svn revert
for the conflicted items was good for me如果您还没有提交更改,您可以执行 TortoiseSVN ->单击恢复并选择未提交的更改并恢复
如果您已提交并且想要撤消更改,则 SVN 日志 ->选择修订版,右键单击,然后恢复该特定修订版的更改。然后提交代码
If you haven't committed the changes, you can do TortoiseSVN -> click Revert and select the Uncommitted changes and revert
If you have committed and if you want to Undo the changes then SVN logs -> select the revision, right click and then Revert the changes of that particular revision. then commit the code
无论如何,只要对所有冲突执行
svnresolve
并提交:然后,通过合并回原来的位置来正式撤消它:
就是这样,合并已在目录中撤消。现在也提交一下:
相对于 svn revert -R . 方法的优点是添加的文件都被正确删除。
Just do
svn resolve
on all conflicts anyway and commit:Then, officially undo it by merging back to where it was:
That's it, the merge has been undone in the directory. Now commit that too:
The advantage over the
svn revert -R .
method is that the files that were added are all properly removed.