Add Command
The add command adds new files and directories to the CVS repository. The syntax of the add command for a directory is:cvs add directorySuppose, you want to create a directory named, test, the command for the same will be:
cvs add testThe syntax to add a file in the repository is:
cvs add filename cvs commit filenameThe commit command has to be used to actually create a file in the repository. The add command only schedules the file for addition. Suppose, for example, you want to add a new file, new.txt to the CVS repository, use the following command:
cvs add new.txt cvs commit new.txtOptions of the add command
1) -b bug
This option marks the newly added file with bug identifier.
2) -k kflag
It is a sticky option that processes the keywords according to the kflag.
3) -m msg
Adds a new file in the repository with a message, msg. msg is like a comment or some additional information about the file. By using -m option, editor need not be invoked.
4) -r branch
Adds the new file onto a different branch. By default, the branch is the same as the directory.
5) -kb filename
The option -kb is used to add a binary file. For example, to add a binary file, new.gif, the code is:
cvs add –kb new.gif cvs commit –m "New binary file" new.gifA new file named new.gif has been added to the repository with the message New binary file.
Some food for thought
What is the difference between commit and add command?
