Previous Section  < Day Day Up >  Next Section

Recipe 18.19. Customizing Your CVS Environment

18.19.1 Problem

You want to customize your CVS environment: the default editor, filepaths, default repository, and perhaps some command options. You want less typing and more working, or maybe less typing and less working, but at least you'd like to set up your working environment to please yourself.

18.19.2 Solution

Create a .cvsrc file and store it in your home directory. Every user can do this to customize their CVS working environment. This example sets some basic defaults:

cvs -T /tmp 

cvs -d /cvsroot

cvs -e nano

update -dP

checkout -P

cvs -z3

diff -c

These changes do not affect the CVS server at all; this is how you make your life easier on the client side.

18.19.3 Discussion

A lot of CVS documentation will instruct you to set your CVS environment variables in your system profile (e.g., in ~/.bashrc). Using ~/.cvsrc is usually preferable, because it's portable and simple to configure. ~/.cvsrc, when present, overrides any CVS environment variables in ~/.bashrc.

The above ~./cvsrc does these things:


cvs -T /tmp

Sets the temporary directory where you want it.


cvs -d /cvsroot

Sets the path to the default repository, so you don't have to type cvs -d <cvsserver>. This saves you a bit of typing when you're importing new projects; after you initialize a new sandbox, you don't need to specify the repository anyway.


cvs -e nano

Sets the default editor.


update -dP

Checks out new directories but not empty directories.


checkout -P

Does not check out empty directories.


cvs -z3

Sets the compression level. The range is 1-9. Note that higher compression levels place a greater load on the CVS server, and may cause nastiness to flow from the server admin.


diff -c

Formats diff output as context diffs, which are the easiest to read.

As you use your CVS repository, make note of the command options you use the most, so you can set yourself some sensible defaults and save some typing.

18.19.4 See Also

  • cvs(1)

  • Chapter 3 of Essential CVS

  • The CVS Quick Reference on the last page of Essential CVS

  • Local documentation—"Guide to CVS commands" (/usr/share/doc/cvs/html-info/cvs_16.html)

  • Local documentation—"All environment variables which affect CVS" (/usr/share/doc/cvs/html-info/cvs_19.html)

    Previous Section  < Day Day Up >  Next Section