export CVSROOT=:pserver:user@host.domain.com:/home/cvs/dir
export CVSROOT=:pserver:user@host.domain.com:/home/cvs/dir
cvs --help cvs -H commit cvs -H add
cvs login
cvs checkout
cvs -q update [file]
cvs diff [file]
cvs -q commit -m "Comments:........" [file]
vi file.ext cvs add -m "creation log:....." file.ext cvs commit
mkdir new_dir cvs add new_dir
Add New SubDir Tree: cvs add dir_new cvs add dir_new/* cvs -q commit -m "- add directories"
cvs add -kb -m "creation log:....." file.bin cvs -q commit !$
— commit right afterward
cvs log <dir/file>
cvs log -l <dir>
cvs admin -m1.2:"- new text" <dir/file>
rm -f file.ext cvs remove file.ext
rm -rf dir_unwanted cvs remove dir_unwanted/* cvs update -P
mv f1 f2 cvs remove f1 cvs add f2 cvs -q commit -m 'Remove ...'
mkdir newdir cvs add newdir mv olddir/* newdir/
cvs -q update -D "YYYY-MM-DD"
Once you've set CVSROOT and download every file from the cvs server, you won't need to specify CVSROOT any more for cvs status and cvs update, because it is recorded in the cvs archive, under every directory, in file CVS/Root. You still have to issue cvs login (or equivalent) every time before you connect.
Note, yet for cvs checkout, you still need to set CVSROOT.
# To create your personal repository: setenv CVSROOT $HOME/CVSRepos cvs -d init
# set environment variables (put these in your .cshrc) setenv CVSROOT $HOME/CVSRepos setenv CVSEDITOR pico setenv CVS_RSH ssh
# create a new project: cvs import projectname username version1
# how to get a copy of a project for personal use: cvs checkout projectname
# add a file to a project cvs add filename cvs add *.cxx *.h etc...
# remove a file from cvs rm filename cvs remove filename
# or be fancy: alias cvsrm 'rm \!*; cvs remove \!*'
# to check-in your changes cvs commit
# to sync your checked out project to what is # currently in the repository this is real useful # if you have multiple copies of your project # or if you have multiple developers on the same code. # NOTE: this will not kill any of your changes (very cool!) # cvs is smart. It is able to merge any changes # with your current code and does a good job of it. cvs update
# to see differences between what you currently have and # what is in the repository cvs diff filename
#: CVS Checkout
# to get a copy of your project from some time ago. cvs checkout -D "1 day ago" project cvs checkout -D "2 days ago" project cvs checkout -D "4 months ago" project
# ... 12 midnight GMT cvs checkout -D "today" project
# ... now cvs checkout -D "now" project
#: CVS Commit Log
# to see all comments you've made # (sort of an unorganized ChangeLog) cvs log [files]
# show log for all subdirs under current dir. cvs log
# local dir only, no recursion cvs log -l
#: CVS Branches/Tags
# FYI: tags are simple. branches are founded upon tags.
# to check out a branch called RELENG_1_0 cvs checkout -r RELENG_1_0 juggler
# when in a directory with code checked out from a # RELENG_1_0 branch, and you need to merge from the # HEAD branch into RELENG_1_0. cvs checkout -r RELENG_1_0 juggler cd juggler cvs update -j HEAD some_directory_or_files
# to tag one file cvs tag myAwsomeTag file.cpp
# to tag all files cvs tag myAwsomeTag .
# to create a branch cvs rtag -b newBranchName myModuleName
# to create a branch rooted at a previously made tag cvs rtag -b -r myAwsomeTag newBranchName myModuleName
http://www.ssec.wisc.edu/mug/hot_topics/mdf/cvs_quickref.html
If you want to see descriptions of all the changes made to a particular file, you can run cvs log file.
To verify that nobody else is editing the file you want to change, run cvs editors.
If you need to make changes to a file, run cvs edit file. This will make the file writeable and let you know if anyone else is already editing the same file. If you decide that you *don't* need to edit a file, make sure to release the file by running cvs unedit file.
Once you've got a writeable file, go ahead and make all necessary changes. Any changes you make will only apply to this instance of the file and can't affect anyone else (unless you later commit them.)
If you want to see exactly what you've changed in a file you've modified, run cvs diff file. To see more of the context in which a change resides, run cvs diff -c file. You can also see the changes between any two versions with cvs diff -rversion1 -rversion2 file.
After you've got everything fixed to your satisfaction and you want to save your changes to the main repository, run cvs commit or cvs commit file, where file is whatever you want to commit.
This will throw you into your favorite editor (where favorite is defined as whatever the CVSEDITOR environment variable is set to or, if that's not set, whatever the EDITOR environment variable is set to or, if THAT'S not set, you'll be forced to use vi.)
Add a *descriptive* comment documenting what changes you have made to the file. When you are done, exit from the editor and your changes will be made in the master copy of this file.
If you exit out of the editor without entering anything or without saving the text you entered, you'll be asked if you want to (a)bort, (c)ontinue, (e)dit or (!) reuse the message for all remaining directories in this commit.
Enter a to abort the commit.
To get the most recent version of everything in a directory and all subdirectories, run cvs update, which will produce a report like:
cvs update: Updating . cvs update: Updating cmd U cmd/foo.c M cmd/bar.f cvs update: Updating libmdf U libmdf/unix/bletch.f cvs update: Updating doc ? doc/NOTES-TO-MYSELF
In this report, if the first character is a;
U The file was updated correctly.
P Like U, but the CVS server sends a patch instead of an entire file. This accomplishes the same thing as U using less band- width.
M You've made changes to this file. If you want to save these changes to the repository, you'll need to run 'cvs commit'
? This file isn't in the CVS repository; if you don't want to add it to the repository, CVS will print this message every time you do an update, but will otherwise ignore it.
Not shown above is the dreaded C condition, which means somebody else committed a new version to the repository while you were changing this file, and CVS couldn't reconcile your changes with their changes, so it's put both sets in your copy of the file, between '<<<<<<<', '------', and '>>>>>>>' marks.
If everybody does a good job of using cvs edit, you *should* never see this...
If you wanted to abort your local changes and revert to the version on the server, just delete the local file and checkout again. Merely checking out over a modified file won't get it reverted to the version on the server. Or, you can use 'cvs update -C files…'
If you only wanted to update the "cmd" subdirectory of "mdf", you could just run cvs update cmd from the "mdf" directory, or simply cd cmd and cvs update.
If, in the middle of editing a file, you decide you need to start over with a fresh copy of your file, you can remove the file and run cvs update file to get a pristine copy of the original. This command does an implicit cvs unedit on the file. (revoke to last version)
If you'd like to retrieve a specific version of the file for some reason, you can do cvs update -rversion file for a specific revision number.
If you do this, the file will get checked out with a "sticky tag". The only way to get back the main file from the repository is to do cvs update -A file, which gets rid of the sticky tag.
To add a new file to the repository, use cvs add file. This will get added to the repository the next time you run cvs commit.
CvsModule=txt2html.tests #expand into $CvsModule cd $CvsModule cvs import -m "Imported test cases, from Seth Golub" $CvsModule tsun start cvs -q update
.. mv $CvsModule $CvsModule.org cvs -d $CVSROOT co $CvsModule cd $CvsModule dircmp $CvsModule $CvsModule.org dirdel !$
cd $CvsModule cvs -q update
export CVS_RSH=ssh; export CVSROOT=:ext:suntong@cvs.txt2html.sourceforge.net:/cvsroot/txt2html cd /export/cvs/ #expand txt2html cd txt2html/ cvs import -m "Imported sources, txt2html-1.28" txt2html txt2html start cvs -q commit -m '- The latest official release, txt2html-1.28' cvs -q update
.. mv txt2html txt2html.org cvs co txt2html dircmp txt2html.org/ txt2html cvs -q update
RenameFrom=pre-in-list RenameTo=pre.txt
mv $RenameFrom $RenameTo
$ cvs remove $RenameFrom cvs server: scheduling `pre-in-list' for removal cvs server: use 'cvs commit' to remove this file permanently
$ cvs add $RenameTo cvs server: scheduling file `pre.txt' for addition cvs server: use 'cvs commit' to add this file permanently
cvs -q commit -m "- rename $RenameFrom to $RenameTo"
CvsFile=news.txt $ cvs admin -o1.1 $CvsFile RCS file: /cvsroot/txt2html/txt2html.tests/news.txt,v cvs server: /cvsroot/txt2html/txt2html.tests/news.txt,v: can't remove branch point 1.1 cvs server: RCS file for `news.txt' not modified.
$ cvs admin -o1.1.1.1 $CvsFile RCS file: /cvsroot/txt2html/txt2html.tests/news.txt,v deleting revision 1.1.1.1 done
$ cvs admin -o1.1 $CvsFile RCS file: /cvsroot/txt2html/txt2html.tests/news.txt,v deleting revision 1.1 done
cvs admin -o1.2 $CvsFile