Thursday, November 1, 2007

CVS Examples

Adding files to a directory
$ mkdir -p foo/bar
$ cp ~/backend.c foo/bar/backend.c
$ cvs add foo
$ cvs add foo/bar
$ cvs add foo/bar/backend.c
$ cvs add backend.c
$ cvs commit -m "Early version. Not yet compilable." backend.c

Removing files
$ cd test
$ rm *.c
$ cvs remove
cvs remove: Removing .
cvs remove: scheduling a.c for removal
cvs remove: scheduling b.c for removal
cvs remove: use 'cvs commit' to remove these files permanently
$ cvs ci -m "Removed unneeded files"
cvs commit: Examining .
cvs commit: Committing .

Remove directories
Removing directory equals to removing files under the directory you want it to be removed. When you checkout the source with a -P option, cvs will remove the empty directory automatically.

Rename a file
$ mv old new
$ cvs remove old
$ cvs add new
$ cvs commit -m "Renamed old to new" old new

No comments: