Original Japanese version (By Suzuki) is here.
Generating a cvsroot directory and its managing files. It is only once for each CVSROOT. Usually, you only need to do this once for your system.
% cvs init
% cvs import (position in the repository) vender-tag release-tag Ex.: % cvs import project-1/foo susuki SNAP19980610
% cvs add filename and % cvs commit
Notice: You can only add files under your current directory.
If you already add files to repository, just do cvs commit.
% rm file-a % cvs remove file-a
If you haven't rm file-a, cvs complains it.
% cvs checkout (the position of top directory in the repository)
This makes a project under your current directory. And Using with the module function is more useful.
Or, If you've already checkouted once,% cvs updatemakes update current directory recursively. But this is only effecting existing directory. If you want to update directory structure,
% cvs update -Pd
Each option means: P: Prune empty directories, d: Create any directories that exist in the repository if they're missing from the working directory.
% cvs checkout -D 2005-05-31 module
% cvs tag tag-nameadds tags under current directory. If you want to get this by tag name, do next:
% cvs checkout -r tag-name (the position of top directory in the repository)If you want to delete tag use -d. Sometimes I misspelled tags name...
% cvs tag -d tag-name-you-want-to-delete
If this string sequence is found in your file, CVS(Actually RCS) replace this with Id information. Use this in comments.
This is useful! First, you should checkout the managing files of cvs via:
% cvs checkout CVSROOTNow you get the directory CVSROOT under your current directory. Then you edit the modules in this directory. For example,
knuthchap2 project/knuth/Vol1/taocp1/chap2After this, you can checkout chap2 with only next:
% cvs checkout chap2
CVS manual said, ``Almost all'' of the subcommands of CVS work recursively when you specify a directory as an argument. Almost all means, for example, the add subcommand is not effect recursively.
You can get the difference between a current file and the file in the repository which is committed last time by:
% cvs diff filename
% cvs status
You can only know the your own change by cvs diff. If you want to know the others change, use this.
Same as make's -n command. This do not change any files. You can check which files are changed without any change with:
% cvs -n update
Sometimes it is useful using status.
When you've get a heavy conflict, your file becomes totally mess.
The only solution is read the file. Before updating, you can check
file status with cvs -n update
. One the other way is
that you return to one before version.
You need to add tags to your file before making branch. It seems that, first making tags, and next branch information is added to the tags.
% cvs rtag -b -r tag-name branch-name module-name
The difference with tag is that you need only to specify the branch to get the newest revision of the branch.
cvs read .cvsignore in each directory. If you do not want commit
the files, e.g., ppm files and jpeg files, then you put this
file list in your .cvsignore
file.
*.ppm *.jpg
This file globally affects in your environment. You need to take care to use this, but useful.
% cvs update -A
% ls RCS foo.C bar.hh
% mv RCS ../RCS.bak # move % cvs -d /repository/cvsroot import proj yamauchi snap1
% rm /repository/cvsroot/proj/foo.C,v % rm /repository/cvsroot/proj/bar.hh,v % cp ../RCS.bak/foo.C,v /repository/cvsroot/proj/ % cp ../RCS.bak/bar.hh,v /repository/cvsroot/proj/
% mkdir tmp; cd tmp % cvs -d /repository/cvsroot checkout proj % cvs update -r[revnum] foo.C
./viewcvs-install