- ADD A NEW FILE: Once you created such file use the command:
cvs add filename
to add it to the repository.
- COMMIT CHANGES: After you add a new file or change an existing
one, you must commit the changes using the command:
cvs commit -m "I just added some stuff and this is my comment"
Note that if several people are working on the same code and someone
else commits changes before you do, CVS will not let you commit until
you update your code first. See the next point to see how to do that.
- UPDATE YOUR CODE: If you have your code checked out in several
places, such as your CS account and your laptop, once you commit
changes in one place you will need to update the other location to get
those changes. To do that you run the command:
cvs update
To update and pull in a newly created directory, the command is:
cvs update -d
- CHECK OUT YOUR CODE AT ANOTHER $G SITE: Since $G/src is itself
inside CVS this is what you do to "checkout" your project at a new $G
site:
cvs update -d myproject
IMPORTANT! Remember to include tha name of the project to be checked
out ("myproject"), otherwise you will checkout every possible project
in $G/src.
- TAGGING A RELEASE: Anytime you commit changes and install them in
$G, it would be a good idea to tag that version as a realease. CVS
will tag the current state of all your code and you will be able to
retrieve it using the tag name. To tag a release, after you commit the
changes run:
cvs tag mytagname
To retrieve an existing
tagged release run: cvs co -r mytagname
When you want to
checkout your code at a new location and you want a specific release
instead of the latest version, run:
cvs checkout -r mytagname module
- REMOVING CODE: To remove a file you have to delete it first and
then eliminate it from the repository. For this you run:
rm filename
cvs remove filename
As always, for the change to take effect you must
cvs commit -m "I just deleted a bunch of things"
If you want to remove a directory, first you delete all files in that directory. Then you run:
cvs update -P
This command "prunes" all the empty directories.