简体   繁体   English

svn undo old commit,保留新的

[英]svn undo old commit, keep newer ones

I know I can do a reverse merge. 我知道我可以进行反向合并。 But that seems like it is good for undoing the most recent commit. 但这似乎对撤消最近的提交是有好处的。 I have a more complex problem: 我有一个更复杂的问题:

r100 - I want to undo this one
r101 - Keep
r102 - Keep
r103 - Undo this one as well
r104 - Keep
r105 - Keep
r106 - HEAD

Is there an easy way of doing this? 有这么简单的方法吗? r103 modifies r100, others modify different files. r103修改r100,其他修改不同的文件。

我会尝试这样做:使用反向合并撤消r103,然后使用反向合并撤消r100。

Notice that you cannot remove committed revisions from the repository, however you can let SVN automatically modify your local working copy in a way that it reverts a revision or a range of revisions. 请注意,您无法从存储库中删除已提交的修订,但是您可以让SVN以还原修订或修订范围的方式自动修改本地工作副本。 That is eg, if you added a line, it will remove it in your working copy, if you had removed a file, it will add it again etc. 也就是说,例如,如果添加了一行,它将在您的工作副本中将其删除;如果您删除了一个文件,则将再次将其添加,等等。

See Nanne's answer for the command-line version of doing this. 有关执行此操作的命令行版本,请参见Nanne的答案。 In TortoiseSVN on Windows, just click "Undo changes from this revision" in the log window. 在Windows上的TortoiseSVN中,只需在日志窗口中单击“撤消此版本的更改”。

AFter that, simply commit the changes in your working copy. 之后,只需提交工作副本中的更改即可。

You can not easily remove past commits in an SVN repository. 您无法轻易删除SVN信息库中的过去提交。

Please see this question in the SVN FAQ 请在SVN常见问题中查看此问题

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

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