cvs 常用命令记录

//z 纯粹自己备忘
//z 9/19/2011 1:22 PM@is2120.csdn

cvs 命令的形式:
cvscvs-options subcommand subcommand-options


查看帮助:

cvs-H subcommand

cvs status -h

检出文件:

cvscheckout mymodule


更新
cvs update

cvsupdate -P -d
-P 表示删除本地的空目录
-d 表示将任何不在本地工作副本中的新目录更新到本地

在有了本地工作副本后

cvs update  -d 和 cvs checkout的效果差不多

查看文件状态:
cvs status file1

===================================================================

File:file1             Status: Up-to-date

   Working revision:    1.2    Thu Oct 10 14:49:15 2002

   Repository revision: 1.2     /home/srevilak/c/mymodule/file1,v

   Sticky Tag:          (none)

   Sticky Date:         (none)

   Sticky Options:      (none)


$cvs -n update
仅仅看看发生了什么,而不对本地的文件进行更新


提交文件

cvs commit filename

添加新的目录:
cvs add newdir

添加新文件:
cvs add newfile


添加二进制文件
cvs add -kb newfile

显示文件的 commit log
cvs log MyFile.java


cvsupdate -j 1.7 -j 1.10 MyFile.java
得到版本1.7到版本1.10间的变更,并将它们添加到文件的本地副本

本地副本比较异同

cvsdiff -w MyFile.java


得到1.5 和 1.4 之间的不同,并将之应用到本地工作副本,

cvsupdate -j 1.5 -j 1.4 filename

cvscommit filename


删除文件
rm filename //z 必须先从工作副本中删除
cvs delete file
cvs commit

cvs diff filename
显示本地副本和仓库中的版本间的不同

cvs diff -r 1.2 filename
显示本地版本和仓库中1.2的不同

cvs diff -r 1.2 -r 1.3 filename
比较仓库中版本1.2和版本1.3的异同

cvs annotate filename
显示文件的每一行,以revision信息为前缀

cvs 文件 版本 回滚 (cvs file rollback)
//z 2013-04-27 17:19:24 IS2120@BG57IV3.T3667728697.K[T473,L7146,R232,V7537]
CVS doesn't provide a rollback command.  However, you can use the -j to
roll back a file to a previous version. First, determine the version 
that you want to roll back _to_. Let's call it 1.N (where N is some number).
To roll back a file named "foo":

$ cvs update -j HEAD -j 1.N foo

Verify that all is well, and then commit. e.g.

$ cvs update -j 1.9 -j 1.8 foo
$ cvs commit -m "rolled back to 1.8 version" foo

原文地址:https://www.cnblogs.com/IS2120/p/6746006.html