我如何在 Subversion 中返回到旧版本的代码? [英] How do I return to an older version of our code in Subversion?

查看:18
本文介绍了我如何在 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.

我的电脑上有我想要的版本,但提交失败;我得到的消息是提交失败,文件或目录已过期."

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"

Subversion 红皮书有一个 关于这个的好部分.

The Subversion Red Book has a good section about this.

这篇关于我如何在 Subversion 中返回到旧版本的代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆