RCS Commands - Version Control with RCS

Learn essential RCS commands for version control. Discover how to check in, check out, diff, and manage file revisions with RCS.

RCS Commands

Revision Control System (RCS) is a set of command-line tools for managing revisions of files. It allows developers to track changes, revert to previous versions, and collaborate more effectively on codebases. Below are common RCS commands and their usage.

Essential RCS Commands

These commands form the core of interacting with RCS for version control.

Checking In and Checking Out Files

The ci command is used to check in new revisions, while co is used to check out existing revisions.

# To initially check-in a file (leaving file active in filesystem):
ci -u <filename>

# To check out with lock:
co -l <filename>

# To check in and unlock (leaving file active in filesystem):
ci -u <filename>

Managing Specific Revisions

You can retrieve specific versions of a file or revert to them using the -p and -r options with co.

# To display version x.y of a file:
co -px.y <filename>

# To undo to version x.y (overwrites file active in filesystem with the specified revision):
co -rx.y <filename>

Comparing File Revisions

The rcsdiff command is used to compare different versions of a file.

# To diff file active in filesystem and last revision:
rcsdiff <filename>

# To diff versions x.y and x.z:
rcsdiff -rx.y -rx.z <filename>

Viewing Revision Logs and Managing Locks

Use rlog to view the history of check-ins and rcs to manage locks.

# To view log of check-ins:
rlog <filename>

# To break an RCS lock held by another person on a file:
rcs -u <filename>

Further Resources

For more in-depth information on RCS and version control best practices, consider exploring the following resources: