修复 subversion 中已犯的错误 [英] fix a committed mistake in subversion
问题描述
这似乎是人们可能想用 Subversion 做的最基本的事情之一,但我很久没有使用版本控制系统了,不知何故我似乎无法弄清楚这一点,我也不知道在 svn 文档中查看的位置.基本上,修订版 167 工作得很好,但我犯了一个错误并将其作为修订版 168(我不确定错误在哪里).我运行 svn update -r 167
然后 svn revert
将我的工作副本恢复到修订版 167,然后一切又正常了.现在,我想从这里重新开始 - 即对这个工作副本做一个小改动并将其作为修订版 169 提交,完全忽略我在修订版 168 上所做的一切.
This seems like one of the most basic things that one might want to do with subversion, but I haven't been using version control systems for very long and somehow I can't seem to figure this out and I have no idea where in the svn documentation to look. Basically, revision 167 worked perfectly, but I made a mistake and committed it as revision 168 (and I'm not sure exactly where the mistake is). I ran svn update -r 167
and then svn revert
to get my working copy back to revision 167, and everything works again. Now, I want to just start over from here - i.e. make a small change to this working copy and commit it as revision 169, completely ignoring everything that I did on revision 168.
我该怎么做?当我尝试提交时,tortoise svn 给我一个错误,说我需要在提交之前更新我的工作副本,显然这不是我想要的,因为它会让我回到修订版 168.
How do I do this? When i try to just commit, tortoise svn gives me an error saying I need to update my working copy before I can commit, and obviously this is not what I want as it will bring me back to revision 168.
感谢您的帮助!
推荐答案
svn merge -r 168:167
svn ci -m "removing changes from r168"
http://svnbook.red-bean.com/en/1.5/svn.branchmerge.basicmerging.html#svn.branchmerge.basicmerging.undo - 在这里您可以详细了解此技术.
http://svnbook.red-bean.com/en/1.5/svn.branchmerge.basicmerging.html#svn.branchmerge.basicmerging.undo - here you can read about this technique in details.
正如David Rodríguez - dribeas 所提到的,您应该从HEAD
修订版开始.所以在我建议的命令之前执行 svn up
.
as David Rodríguez - dribeas mentioned you should start with the HEAD
revision. So perform svn up
before the commands I adviced.
这篇关于修复 subversion 中已犯的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!