Updating
|
cvs update file or directory name
cvs understands standard wildcard characters like * (e.g. cvs update *.h). The -d option to cvs when you update will grab any modules or files added since you checkout your working copy.
The output of the CVS command provides information about the state of files.
- M - modified file
- U - file updated from repository
- C - conflict with version in repository. cvs puts both the conflicting lines in the file with seperators so you can choose which version you want and commit the changes.
- P - file is patched.
If you really screw up bad, just remove the file (without using cvs remove ) and do a cvs update of the file to get a new copy back.
Finally, I strongly recommend updating before checking changes into the repository. Theoretically, people will be working on different files, but it helps avoid problems and identifies what needs to be checked in.
|
Releasing a working copy
|
cvs release module
Use this command when you are finished with a coding session. It will inform you if you have any modified files that you need to check in. When the command completes, then it is safe to delete your working copies.
OR - have cvs do it for you. Type cvs release -d module to have cvs check for modified files and then remove the working copy for you.
|
Adding files and directories
|
-
Adding files:
- cvs add filename
- cvs commit filename
-
Adding directories:
- cvs add directory
|
Viewing Logs
|
cvs log [filename|directory]
Prints out a list of all changes to the file. If you have been adding comments like a good developer, you will see a history of changes.
Jim was a good programmer. He commented his commits and now he easily find what happened when things go wrong.
Jack was a bad programmer. He has terrible bugs and doesn't know when he introduced him.
Be like Jim, comment your commits. 
|
Tagging Files
|
cvs tag tagname filename
The tag command allows you to supply a name to the current version of a file in your working copy. This tag can then be used to refer to that particular revision. Typing cvs status filename will display version and tag information.
|
Removing files and directories
|
- rm [filename|directory]
- cvs remove [filename|directory]
- cvs commit -m "Why I removed the file" [filename|directory]
ALWAYS remove files with this procedure rather than deleting them from the repository proper. Never touch the repository proper. There there be dragons. Big ones with nasty pointy teeth. This also leaves a record of why the file is no longer relevant and possibly allow for recovery.
|