CVS的命令行使用


在修改网页时,就怕忘记修改了哪里。

有了cvs,放心多了。熟记几个常用的命令:提交,取回,比较。


part 1


1    repository
this is a place to hold all you source code,and code change record.

2    init
when start to use cvs, must first to init the repository.
this will make some dir and some file to manage the store of you source code .

3    import
before using the cvs , one step is add you code to repository. the add of the first time name "import the project".
it has special grammer.

4    export
this means get all you code to a dir, but have no version revise infomation.

5    checkin, commit
this means when you change you code in work dir, make the change store to repository.

6    checkout, update
this means use the code to repository to overwrite you work dir code copy .

7    tag    stick tag    revision
revision:    the version number
tag:        make the source code of one time have a name
stick tag:    when a work dir copy has a stick tag, the change of the code relate to that tag , not to the head viersion.

part 2

1    ref to a repository
set the variable CVSROOT , or use the option before command

[For csh/tcsh: setenv CVSROOT ~/cvsroot]
[For bash/ksh: CVSROOT=~/cvsroot;export CVSROOT]

or



2    inin the repository
cvs init

3    put this program under cvs first time

cvs import -m "Sample Program" project sample start


example:

cvs import -m "oa program" oaprj byremindrobot start


If your were importing your own program, you could now delete the original source.(Of course, keeping a backup is always a good idea)

4    to modify the code,to check out the source
cd to your  directory ,

cvs checkout project

This creates the project directory in your home directory and puts the files.

5    You can now make changes to any of the files in the source tree, store change to

cvs commit -m "Added a DONE message." main.c


6    get  changes with the changes made by developer one. To do this

cvs update foo.c

7    merge our changes with the changes made by developer one. To do this

cvs update foo.c
    when have confilct , change it and

cvs commit -m "Added TOO" foo.c

8    To add a new file to a module:

Get a working copy of the module.
Create the new file inside your working copy.
use cvs add filename to tell CVS to version control the file.
use cvs commit filename to check in the file to the repository.

9    Removing files from a module:
Make sure you haven't made any uncommitted modifications to the file.
Remove the file from the working copy of the module. rm filename.
use cvs remove filename to tell CVS you want to delete the file.
use cvs commit filename to actually perform the removal from the repository.
For more information see the cvs man pages or the cvs.ps file in cvs-1.7/doc.

part 3

1    how to use cvs by give composite in cmd line
cvs –d my_cvs_repos command [command-options-and-arguments]

2 force to  change reversion  (this will make the work file to stick tag)
cvs commit -r 2

3    tag the project
cvs tag release_1_0

4 checkout or export a   module to current dir
    get a work one with cvs dir
cvs checkout -d . oa50
    get a clean version
cvs export -D now -d . oa50

5 restore a old version (only one file )  (this will make the work file to stick tag)
cvs update -p -r1.2 file_name >file_name

6    force to remove all stick tag (this will merge change to head revision )

    cvs update -A


part 4

比较文件不同

7 cvs diff


猜你喜欢

转载自blog.csdn.net/findee/article/details/11844167
今日推荐