This is a guide to get you started using CVS to check out code instead of cvsup. The main advantage of this is that you easily can keep local changes to FreeBSD, and that you get access to the history of the FreeBSD project. The document assumes you have ports/net/cvsup installed. There are a few basic things you need to be able to use FreeBSD with CVS instead of cvsup (using cvsup to mirror the repository instead of the code). 1. You need a copy of the FreeBSD CVS repository. 1A: If you run cvsup-mirror, you already have a CVS repository (somewhere on your machine); create a symlink from /home/ncvs to the repository, and make sure the user you usually work is a member of the cvsupin group (unless it is root, in which case things will work anyway). NOTE: This part is not tested, as I don't run cvsup-mirror at the moment. 1B: If you don't run cvsup-mirror, you need to create a cvs repository. The easiest way to do this is to do the following: mkdir /home/ncvs cd /home/ncvs fetch http://people.freebsd.org/~eivind/cvsupdate chmod 755 cvsupdate ./cvsupdate When you need to update the repository, just run /home/ncvs/cvsupdate The CVS repository takes about 1.5GB. 2. You need to check out /usr/src using CVS instead of cvsup, in order to get proper CVS metadata. The following shell commands will do that: cd /usr mv src src.cvsupped cvs -d /home/ncvs checkout -P src # READ BELOW The above will check out *-CURRENT*. If you want -stable (4.x aka RELENG_4), do cd /usr mv src src.cvsupped cvs -d /home/ncvs checkout -rRELENG_4 -P src src.cvsupped is just a backup of your old src; you can delete it when you get comfortable with the new source tree being OK (should be OK at once) 3. You need to check out ports. Ports are always developed as the "HEAD" of the source (like -current), and checkout will usually be cd /usr mv ports ports.cvsupped cvs -d /home/ncvs checkout -p ports rmdir ports/distfiles mv ports.cvsupped/distfiles ports/distfiles ports.cvsupped is now an old copy. You are now ready to start using cvs instead of cvsup for "normal operations". Of course, you then need to know the "normal operations". They are described below. In these descriptions, it is assumed that you have an alias installed so lcvs is translated to cvs -d /home/ncvs This would be installed with alias lcvs='cvs -d /home/ncvs' I also assume a .cvsrv in your homedir with the contents cvs -q diff -u update -P -d checkout -P Now, for the activities: UPDATE CVS REPOSITORY You have to do this before you can update src or ports. This mirror the differences between the newest version developed by FreeBSD and the version you have available locally. To do the update, do /home/ncvs/cvsupdate (If you are using cvsup-mirror, you'll get automated updates and do not need this step.) UPDATE SRC Update the sources you have from the local CVS repository. This assumes that you have done 'UPDATE CVS REPOSITORY' sometime between the last time you updated src and now. cd /usr/src lcvs update UPDATE PORTS Update the sources you have from the local CVS repository. This assumes that you have done 'UPDATE CVS REPOSITORY' sometime between the last time you updated src and now. cd /usr/ports lcvs update Note that if you install ports/misc/porteasy, you can also update a single port with all dependencies by doing porteasy -r /home/ncvs -u CHECK WHAT HAS HAPPENED WITH A FILE To check basic information, do lcvs log | less If you want to check along a particular branch (like RELENG_4 for 4.x or HEAD for -current), do lcvs log -rRELENG_4 | less If you want to check for only a particular revision, do lcvs log -r | less CHECK WHEN EACH LINE IN THE FILE WAS INTRODUCED (This assumes that the port textproc/cdiff is installed. If it isn't, you can use less instead, but cdiff is IMO nicer.) Get the basic information with lcvs annotate | cdiff To check from a particular version, do lcvs annotate -r | cdiff CHECK WHAT CHANGES YOU HAVE DONE LOCALLY If you want to know what changes you've done to a file, CVS can report that automatically in a fairly readable format. In order to get the differences for a file, do lcvs diff In order to get the differences for an entire directory, do cd /where/you/want/to/find/differences/from lcvs diff | cdiff Example (finding changes you've done to your kernel code, if you're a kernel hacker): cd /usr/src/sys lcvs diff | cdiff CHECK WHAT CHANGES FREEBSD HAS DONE You can also check differences between different points in FreeBSD development. If you want to know what changes have been done from some particular point in time compared to your present "workspace" (set of checked out files), you can do lcvs diff -D'a forthnight ago' | cdiff You can replace 'a forthnight ago' with just about any way of specifying the date - unfortunately, "just about any way of specifying the date" does not include what CVS itself outputs. Also, this only works for -current, unfortunately - this is a weakness in CVS. You can check what differences have been made in FreeBSD compared to what you have checked out by lcvs diff -r | cdiff Replace with e.g. RELENG_4 for 4.x-stable, or HEAD for -current. You can check differences between two revisions with lcvs diff -r -r | cdiff E.g, to see what was changed in revision 1.100 of /usr/src/Makefile.inc1, you would do lcvs diff -r1.99 -r1.100 /usr/src/Makefile.inc1 | cdiff A nice trick to use to look at differences with more context is to add a -u to the CVS diff line. I often use very large numbers to get the entire file with changes marked - e.g, if I was looking at the above change, I might choose to do lcvs diff -u10000 -r1.99 -r1.100 /usr/src/Makefile.inc1 | cdiff to see the entire file with changes marked. There are also a bunch of other things you can do with cvs; man cvs gives more background.