我们可以选择从 CVS 中签出什么版本吗
我已经更新了几次 cvs,并且想要获取旧版本之一,是否可以获取同一文件的不同版本?或者应该只是最新签入的版本?
I have updated cvs a few times and want to get one of the older versions, is it possible to get different versions of the same file? Or should it be only the latest checked in version?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
切换到某个版本号:
cvs update -r 1.42 myfile
切换到某个标签:
cvs update -r mytag
切换到某个日期:
cvs update - D 'last friday 12:00 PST'
如果您尚未签出某些版本,您可以将
-r
或-D
直接传递给CVS 结帐
。这些都会将您的工作副本切换到您指定的修订版或日期(这称为“粘性标签”)。要返回到头部修订版,请发出
cvs update -A
。您还可以使用
-p
选项将特定修订版本检索到不同的文件中:cvs update -p -r 1.42 myfile >myfile-1.42
。这不会影响您的myfile
工作副本。Switch to a certain revision number:
cvs update -r 1.42 myfile
Switch to a certain tag:
cvs update -r mytag
Switch to a certain date:
cvs update -D 'last friday 12:00 PST'
If you haven't already checked out some version, you can pass
-r
or-D
directly tocvs checkout
.These all switch your working copy to the revision or date you specified (this is called a “sticky tag”). To go back to the head revision, issue
cvs update -A
.You can also retrieve a specific revision into a different file with the
-p
option:cvs update -p -r 1.42 myfile >myfile-1.42
. This doesn't touch your working copy ofmyfile
.是的 - 用 CVS 的行话来说,听起来您已经提交了多个版本(到存储库),现在您想要恢复以前的版本之一......所以您将更新您的沙箱。如果它是一个特别有趣的转速,您可能需要标记它,以便您可以再次找到它,而无需使用转速号。
在任何一种情况下,您都可以像这样运行 cvs 命令:
但要知道,如果您运行其中任何一个,您的本地副本中都会有一个“粘性标签”,并且无法从那里提交回来。 (运行“cvs status foo.java”以查看粘性条)...因此,如果您想处理该版本并对其进行调整,您可能需要首先创建一个分支...然后如果您运行:
您将能够将更改提交回存储库。
Yes - in the lingo of CVS it sounds like you have committed several versions (to the repository) and now you want to get one of the previous revs back... so you will be updating your sandbox. If it's a particularly interesting rev, you might want to TAG it so you can find it again without having to use the rev number.
In either case you might run a cvs command like so:
But know that if you run either of those, you will have a "sticky tag" in your local copy and cannot commit back from there. (Run "cvs status foo.java" to see the sticky)... so if you want to work on that rev and tune it up, you might want to create a branch first... then if you run:
you will be able to commit changes back to the repo.