| |
|
 |
Version Control management with CVS - Part 2
|
Adding files
Being able to do changes and committing them is now possible, but how do you add new files to the repository? Thanks to marvelous new technology this is possible with a few simple steps.
The command for adding new files is add. For instance to add the installation file you do:
You can also add sub-directories, for instance if src is a sub-directory do:
But remember only the sub-directory will be added not the content, you need to add these yourself afterwards.
If you have more than one file to add you can specify them all to the command line, to add all .cpp files, the FAQ and the installation file do:
cvs add *.cpp FAQ INSTALL |
After the file(s) are added you need to commit the changes, this allows you to write an nice initial message explaining why you added it.
There is one important thing you should know about files in the CVS repository, and that is that they never disappear (they never get smaller either). It will disappear from the local copy and the local files may look smaller, but in the real CVS repository all changes you, and your co-developers, have ever committed will be present.
At first this might seem strange, but consider what would happen if you wanted an earlier version of the project and the files didn't exist anymore? Well it wouldn't work. That is why CVS keeps all information sent to it.
With this said you probably wonder how you remove files from CVS. As always you do this with a CVS command and this time it's called remove.
For instance to remove the installation file we added earlier do:
But remember CVS will not remove the file in the repository unless it is removed locally first(it can be renamed/moved too if you want to keep it), the file will now be marked as removed.
To perform the removal you have to do a commit (with a nice comment). The file will then be moved, in the repository, from the current directory to a sub-directory called Attic. All removed files will be put in the Attic.
Comment List
| Topic: |
Author: |
Time: |
|
regexps are supported
|
Marius Sundbakken
|
26.11.2000 05:23
|
|
When commiting changes, it is often necessary to commit both the header file and the source file, and conveniently, cvs support:
cvs commit foobar.*
|
|
RE: regexps are supported
|
Jan Ekholm
|
27.11.2000 10:57
|
|
> When commiting changes, it is often necessary to commit both the header file and the source file, and conveniently, cvs support:
>
> cvs commit foobar.*
Isn't this expanded by the shell? CVS just gets the expanded list, such as:
cvs commit foobar.h foobar.cpp
Or am I out in thw woods here?
|
|
RE: RE: regexps are supported
|
Michael Krumpus
|
27.11.2000 15:40
|
|
> > When commiting changes, it is often necessary to commit both the header file and the source file, and conveniently, cvs support:
> >
> > cvs commit foobar.*
>
> Isn't this expanded by the shell? CVS just gets the expanded list, such as:
>
> cvs commit foobar.h foobar.cpp
>
> Or am I out in thw woods here?
You are correct. The shell handles this, not CVS (or any other program).
|
|
 |
|
|