- If the code that was inside of the original directory resides in that directory, everything worked properly.
Adding a File to an Existing Project
- We first must checkout the code(see above) and then enter the created directory:
- Next we create the file in one way or another. I find it useful to create the file and then immediately add it to the CVS tree before editing, so that I do not forget to add it later. So we create the file with the touch command:
- mysubroutines]$ touch newfile
- Then we add the file to the CVS tree:
- mysubroutines]$ cvs add newfile
- If everything is in order, cvs returns the following information:
- cvs add: scheduling file `newfile' for addition
- The file has been added to the CVS project. After committing the changes (see below) it will become a "permanent" part of the project.
Removing a File
- This is somewhat unusual, but can occur. First, delete the file from the working directory:
- mysubroutines]$ rm newfile
- Then remove it from the CVS tree:
- mysubroutines]$ cvs remove newfile
- After committing the changes (see below) it will be removed from the project.
- Changes are committed quite easily:
- mysubroutines]$ cvs commit
- A log will open up in your preferred editor (set by editor environment variable) outlining the files added, removed or altered. They will initially be commented out. You should uncomment these lines so that if you check the CVS log you will know when files were altered. You can also add comments about which files are unfinished or how long you worked on it, or whatever you wish to add to your log. When you are done you should save and exit the editor.
- Although these commands are necessary to obtain a working CVS tree, they might not be sufficient for all purposes. For further information, check the man pages or the CVS home page.
- When you are done working on the project for the day and you have committed all your changes, there is a very simple way to clean up the working directory:
- tmp]$ rm -rf mysubroutines