如何在Subversion中返回我们的代码的旧版本? [英] How do I return to an older version of our code in Subversion?
问题描述
我正在与一个朋友一起从事一个项目,我想返回到我们的代码的旧版本并将其设置为当前版本.我该怎么办?
I'm working on a project with a friend and I want to return to an older version of our code and set it to be the current. How do I do it?
我在vs08上使用"anksvn".
I'm using "anksvn" on vs08.
我的PC上有所需的版本,但是提交失败;我收到的消息是 提交失败,文件或目录已过期."
I have the version that I want on my PC, but the commit is failing; The message that I get is "commit is failed, file or directory is out of date."
我的PC上也有Subversion客户端.
I also have the subversion client on my PC.
推荐答案
基本上,您需要向后合并"-在当前版本和先前版本到当前版本之间应用差异(因此,结束并使用看起来像旧版本的工作副本),然后再次提交.例如,从修订版150(当前)回到修订版140:
Basically you need to "merge backwards" - apply a diff between the current and previous version to the current version (so you end up with a working copy looking like the old version) and then commit again. So for example to go from revision 150 (current) back to revision 140:
svn update
svn merge -r 150:140 .
svn commit -m "Rolled back to r140"
The Subversion Red Book has a good section about this.
这篇关于如何在Subversion中返回我们的代码的旧版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!