颠覆中的回归
假设我想在 Subversion 中恢复版本 n 和 (n-1) 之间的一些更改。
我只需放回版本 (n-1) 中的文件 - 从存储库中取出它们并作为主干中的最新版本签入。
在这里,他们似乎想从版本(n-1)创建一个分支并将其与主干合并回来。
这如何更好或“更正确”?
在本例中,它是一个目录中的几个文件。 这些文件最近没有其他更改。
Say I want to revert some changes between version n and (n-1) in Subversion.
I would just put back the files from version (n-1) - take them from the repository and check back in as the latest version in the trunk.
Here it seems they want to make a branch from version (n-1) and merge it back with the trunk.
How is this better or "more correct"?
In this case it is a few files within one directory.
These files do not have other recent changes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为您和其他人彻底删除错误的提交...
“恢复”不是您正在寻找的,因为它只影响本地更改。为了恢复已经提交的修订版,您必须使用“svn merge”,使用否定语法,在您想要删除的修订版前面放置一个“-”(减号)。示例:
这样您就可以将您的存储库与rev“-1330”并随后进行签入,从而为您和其他开发人员删除 1330 中的更改。
将要
To cleanly remove a bad commit for you and for others...
the "revert" is not the one you are looking for, because it only affects local changes. in order to revert a already submitted revision you have to use "svn merge" using the negate syntax by putting a "-" (minu) in front of the revision you wish to remove.example:
so you do reverse-merge your repository with rev "-1330" and do a checkin afterwards thus removing the changes from 1330 for you and the other developers.
Will
要删除特定修订之间的更改,例如过去的 1000 和 1010:
从签出到数据工作副本类型:
这将删除工作副本中修订 1000 和 1010 之间的所有更改(不包括添加到 1000 本身的更改) 。只要您没有进行任何本地修改,并且在验证它确实达到了您想要的效果之前不要重新检查结果,那么就可以安全地使用此方法。
在您的特定情况下,由于您只想删除单个修订版,因此您可以使用“-c”而不是更通用的 -r:
这相当于 -r 1999:2000 删除 1999 年和 2000 年之间的更改。
To remove changes between specific revisions, say 1000 and 1010 in the past:
From a checked out, up to data working copy type:
This removes all the changes in your working copy between revisions 1000 and 1010 (not including changes added to 1000 itself). It's safe to play around with this as long as you don't have any local modifications and don't check the results back in until you've verified that it did what you wanted.
In your particular case since you only want to remove a single revision you can use '-c' instead of the more general -r:
This is equivalent to -r 1999:2000 removing the changes between 1999 and 2000.
使用
svn merge
,它对您的场景非常有用。Use
svn merge
, it's very useful for your scenario.