如何还原到CVS中的先前提交 [英] How to revert to previous commit in CVS

查看:102
本文介绍了如何还原到CVS中的先前提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于遗留原因,我在一个项目上使用了CVS。最近,我做了一些更改,破坏了我们的代码,我需要还原它们。 git revert -r< old_revision> 的CVS类似于什么?

For legacy reasons, I'm using CVS on a project. Recently I committed some changes which broke our code and I needed to revert them. What's CVS's analog of git revert -r <old_revision>?

看看过去的问题,例如如何恢复大变化,CVS提交不会对文件进行分组改变了。

Looking at past questions like How to revert big change, CVS commits don't group the files that were changed. Is the only way to revert by using dates?

此外,查看过去的更改的最佳方法是什么? CVS日志输出的信息过多,其中大多数是不必要的。我想查看提交消息和更改的文件。

Also, what's the best way to view past changes? CVS log outputs too much info, most of which is unnecessary. I want to see commit messages and changed files.

推荐答案

可以找到CVS文档此处,但从此站点告诉您如何还原单个文件:

CVS documentation can be found here, but from this site it tells how to revert a single file:


制作旧版本当前版本

保存旧文件的版本,到其他东西,并检查当前

注意:您仍然必须执行update -A来获取当前版本,因为即使您具有>重命名

oldfile标签仍然与文件 oldfile相关联。并且直到>才被删除

Save the version of "oldfile" to something else and check out the "current" version.
Note: you must still to do update -A to get the current version, because even though you have > renamed
"oldfile" the tag is still associated with the file "oldfile" and is not removed till > update -A is done.

然后将 old重命名为版本为当前版本。版本。

%mv oldfile oldfile.old.ver

%cvs update -A oldfile

%mv oldfile.old.ver oldfile

%cvs commit -m还原至版本1.5 oldfile

Then rename the "old" version to the "current" version.
% mv oldfile oldfile.old.ver
% cvs update -A oldfile
% mv oldfile.old.ver oldfile
% cvs commit -m "reverting to version 1.5" oldfile

您现在可以照常进行检出,编辑和提交文件。

You can now carry on checking out, editing and commiting the file as normal.

这不会不能以递归方式处理许多文件,但希望会有所帮助。

This won't handle many files in a recursive fashion, but hopefully helps.

这篇关于如何还原到CVS中的先前提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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