--------------------------------------------------------------------- Notes: CVS - Concurrent Versions System Fri Mar 2 2001 B. Luhrs --------------------------------------------------------------------- SUMMARY OF COMMANDS: # CVS-related ENV VARIABLES $ export CVS_RSH=ssh # use SSH for remote CVS # .cvspass - password storage on ~ ? $ export CVSROOT=/home/cvs/msie01 # local system $ export CVSROOT=:ext:bluhrs@bob.marlboro.edu:/home/cvs/msie01 # remote sys # IMPORT: CREATING a PROJECT - start in parent directory (project name) $ cvs import -m "initial project import to CVS" bluhrsproj bluhrs start # $ cd .. # save off a snapshot # $ mv bluhrsproj v0_bluhrsproj # CHECKOUT a PROJECT (on same system, or remote system, as CVS repository $ cvs -d /home/cvs/msie01 checkout GCGPpm $ cvs -d :ext:bluhrs@bob.marlboro.edu:/home/cvs/msie01 checkout javawiki $ cvs checkout bluhrsproj # checkout with CVSROOT, CVS_RSH defined # CVS files in a project directory tree CVS]$ ls Entries Entries.Log Repository Root # DIFF - seeing the difference between checked-in & working copies $ cvs -Q diff -c # most useful format $ cvs diff -c README.txt # DIFF on a single file $ cvs diff -c -r 1.2 -r 1.3 README.txt # DIFF between revisons # COMMIT/CHECKIN an edited project or file $ cvs commit -m "add sample edit" README.txt $ cvs ci -m "updated edit time conflict" # STATUS $ cvs status README.txt # shows up-to-date, locally modifies $ cvs status # or needs-merge # UPDATE - updating your working copy from the repository $ cvs -q update $ cvs update README.txt $ cvs -Q update -p -r 1.3 README.txt > REAME.txt # source for v1.3 # getting a previous revision # LOG - viewing project log messages $ cvs log README.txt $ cvs log # ADDING a new file (2 steps) $ cvs add newfile.txt $ cvs ci -m "adding to project" newfile.txt # ADDING a new directory (after add individual new files) $ mkdir images $ cvs add images # RENAMING a file (from newfile to revfile) $ mv newfile.txt revfile.txt $ cvs remove newfile.txt $ cvs add revfile.txt $ cvs ci -m "rename newfile to revfile" newfile.txt revfile.txt # TAGGING current versions of files as a "release" $ cvs -q tag Snapshot-2001-02-25 # BINARIES & Special String Expansion $ cvs commit -m "rev-string-replace" Revfile.txt # $Revision$ -> $Revision: 1.3 $ $ cvs add -kb filename # turn off keyword expansion & line-end conversion $ cvs ci -m "added blah" binfilename # JOIN (reverting to a previous version) ORDER CRITCAL $ cvs update -j 1.4 -j 1.3 README.txt $ cvs commit -m "reverted to 1.3" README.txt # INIT and STARTING A REPOSITORY (on Linux carson-city.marlboro.edu) # CVS comes with Linux, so create local repository # login as root, and create the directory & CVS repository # subdirectory CVSROOT & CVS administrative file are created kid]$ su local]# mkdir /usr/local/cvsrepos local]# cvs -d /usr/local/cvsrepos init # CHGRP/CHMOD make the new repository accessible to "users" group cvsrepos]# chgrp -R users . # change group ownership cvsrepos]# chmod ug+rwx . CVSROOT # change access rights # GPASSWD/GROUPS add "kid" user account to "users group" /etc]# gpasswd -a kid users # add "kid" to "users" Adding user kid to group users /etc]# groups kid # show "kid" membership in "users" kid : kid users cvsrepos]# more /etc/group # see effects on /etc/group ... users:x:100:kid # IMPORT -user = "kid" setups up a project repository # ("kid" had to LOG OUT & LOG BACK IN) kid]$ cd /home/kid/cvs/newproject newproject]$ export CVSROOT=/usr/local/cvsrepos newproject]$ cvs import -m "initial import to local CVS" newproject bluhrs start newproject]$ cd .. cvs]$ rm -fr newproject # remove orignal files cvs]$ cvs checkout newproject # checkout project, now under source control - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - REFERENCES: =========== $ man cvs # get's CVS man-pages $ info cvs # get's on-line CVS manual Open Source Development With CVS - Free web-site chapters http://cvsbook.red-bean.com/cvsbook.html Running Linux, 3rd Edition, 1999 Welsh, Dalheimer & Kaufman, O'Reilly, pg 505-510 --------------------------------------------------------------------- WINDOWS NOTES: - UNABLE TO GET ftp://ftp.cvshome.org/pub/cvs-1.10.15/windows/cvs.exe (898K) ============== RUNNING as a CVS_client on Windows ME, www.cvshome.org - CVS Home C:\Bruce\GradCenter\Tools>cvs.exe C:\Bruce\GradCenter\Tools>SET CVSROOT=:ext:bluhrs@bob.marlboro.edu:/home/cvs/msie01 C:\Bruce\GradCenter\Tools>SET CVS_RSH="C:\Program Files\SSH Communications Security\SSH Secure Shell\SshClient.exe" CVSROOT=:ext:bluhrs@bob.marlboro.edu:/home/cvs/msie01 CVS_RSH="C:\Program Files\SSH Communications Security\SSH Secure Shell\SshClient.exe" C:\Bruce\GradCenter\Tools>set HOME=C:\Bruce\GradCenter\Tools C:\Bruce\GradCenter\Tools>type .cvspass bluhrs-bob-password C:\Bruce\GradCenter\Tools>cvs status CVS.EXE [status aborted]: cannot start server via rsh: Permission denied