Cvs Frequently Used Commands
iDog
Basics
Check out code:
cvs co [-r <tag or branch>] [-d <dir name>] <module name>
Update code:
cvs upd [-r <tag or branch>] [-d/-l] [-A]
-d: Build directories, like checkout does.
-l: Local dir only, no recursion.
-A: Reset any sticky tags/date/kopts.
Check in code:
cvs ci -m "comment" [<file name or list of file names>]
Show status of a file:
cvs stat <file name>
cvs log <file name>
Diff between two versions of a file:
cvs diff [-bB] -r <rev> [-r <another rev>] <file name>
Create a new module
- arrange files of the project in a dir
- import it to CVS:
cvs import -m <comment <module name> <vendor tag> <release tag>
Eg:
cvs import -m "my project" myprj iDog start
Tagging code
- go to home dir of the module checked out
- cvs tag -cR <tag_name>
- cvs will prompt you if there are any files modified but not checked in.
To remove a tag:
cvs tag -d <tag_name>
Create a branch
Go to home dir of the module checked out and do following:
cvs tag -bcR
cvs rtag -b -r <tag_name> <branch_name> <module_name>
Sticky tag and commit
If you check out the code by using the following command:
cvs co -r my_tag goat
then after you modified some file, you will find that you cannot commit the change: CVS reports the following error:
cvs commit: sticky tag `my_tag' for file `my_file' is not a branch
To solve this problem, we should first remove the sticky tag:
cvs upd -A my_file
now it's commitable. One thing to remind is that if you use this command to a file which has been updated by someone else, but the current version is not the latest one, the other people's modification will also be applied...
For files shared by everyone, we should check the code out by putting it to a branch.
Merging branch back to top
cvs co <module>
cvs upd -j <branch name>
# resolve all conflicts if applicable
cvs ci -m "merge branch <branch name> back to top"