CVS Cheatsheet
#
Concurrent Versions System (CVS) is a version control system that allows multiple developers to work on the same project without overwriting each other’s changes. It maintains a history of all changes to files in a repository, which can be retrieved and examined. CVS was developed by Dick Grune as a series of shell scripts in July 1986, and later evolved into a complete version control system used extensively in open source and commercial software development.
Repository Management
#
Command/Option | Example | Description |
---|
cvs init | cvs init | Initialize a new CVS repository |
cvs checkout (co) | cvs checkout module_name | Check out a working copy from a repository |
Working with Repositories
#
Command/Option | Example | Description |
---|
cvs update (up) | cvs update | Bring changes from the repository into the working copy |
cvs commit (ci) | cvs commit -m "Commit message" | Send changes from the working copy to the repository |
cvs add | cvs add file.txt | Schedule a file or directory for addition to the repository |
cvs remove (rm) | cvs remove file.txt | Schedule a file or directory for removal from the repository |
cvs tag | cvs tag TAGNAME | Tag the repository at the current file revisions |
cvs rtag | cvs rtag TAGNAME module_name | Tag the repository at the current file revisions without checking them out |
Viewing Changes
#
Command/Option | Example | Description |
---|
cvs status (stat, st) | cvs status | Print the status of files in the working directory |
cvs diff | cvs diff | Display the differences between working copy and repository |
cvs log | cvs log | Show the log messages for a set of revisions |
Branching and Merging
#
Command/Option | Example | Description |
---|
cvs tag -b | cvs tag -b branchname | Create a branch tag |
cvs update -j | cvs update -j branchname | Merge changes from a branch into the working copy |
cvs update -A | cvs update -A | Reset any sticky tags, dates, or options on the working copy |
Repository Maintenance
#
Command/Option | Example | Description |
---|
cvs admin | cvs admin -mRev:msg file.txt | Perform repository administrative tasks |
cvs history | cvs history | Show the history of files and users |
cvs release | cvs release -d module_name | Safely release a checked-out module |
Miscellaneous
#
Command/Option | Example | Description |
---|
cvs annotate | cvs annotate file.txt | Show the last modification for each line of a file |
cvs watch | cvs watch add file.txt | Set a watch on a file to monitor commits |
cvs unedit | cvs unedit file.txt | Undo an edit command |
cvs export | cvs export -r TAG module_name | Export a clean directory tree of the module at the specified tag |
cvs import | cvs import -m "Import message" module vendor release | Import sources into CVS, using vendor branches |
cvs checkout -r | cvs checkout -r TAG module_name | Check out a module as it existed at the specified tag |
This cheatsheet covers the most commonly used CVS commands and options, helping you to manage repositories, commits, branches, merges, and more effectively.