Update Command
After you have invoked checkout command and already created a copy of that file in your working directory, you might want to get an updated copy of that file in your working directory. This is when the update command comes in handy. The syntax of the update command is:cvs update filenameOptions of the update command 1) -D date
Uses the latest version of the file not later than the date. There are various ways to specify date many of which are given below:
2 months ago
2 hours ago
8000 seconds ago
last year
last Tuesday
yesterday
a fortnight ago
3/31/92 10:00:07 PST (the format is month/date/year)
February 28, 1990 01:00pm
20:00 GMT
Here, the date is a sticky option. Here is an example:
cvs update -D last Wednesday test/basics/LearnCvs2) -r tag
Revision tag, tag is implemented.
3) -f
This option is used mostly with -D date option or -r tag option. If the specified version of the file is not found then the latest version of the file is retrieved from the repository instead of ignoring the command.
4) -l
This option causes the update command to retieve the files in the specified folder only and not in the sub-folders.
5) -P
This option tells the update command to avoid copying any empty directory or empty sub-directory.
6) -p
The file is copied to the console only. It will not be saved to the disk.
7) -A
Resets any sticky keys, dates or ktags option. The sticky options of all the updated files will be restored to their repository values. Below is a demonstration:
cvs update -A8) -k kflag
It is a sticky option that processes the keywords according to the kflag. Updates to this file in the working directory will use kflag.
9) -R
The directory will be updated along with all the files and sub-directories within it.
10) -B bug
Marks updated files as belonging to bug, bug.
11) -C
Overwrite locally modified file with the original file in the repository.
12) -c
If the file is edited, update the base revision copy to the latest revision. If this option is not used an unedit will always revert to the same revision that is edited, not the latest revision in the repository.
13) -d
Normally, update does not create new directories in the working directory. It updates only in the directories that already exist in the working directory. This option creates any directories that are not in the working directory but exist in the repository. Suppose, the folder named test does not exist already in the working folder but exists in the repository. To update test to your working directory, the CVS command is:
cvs update -d test14) -I filename
This option updates all the files of the directory except the file named, filename. For example, to update all the files in the directory, my_project, except new.txt, the command is:
cvs update –I new.txt my_project15) -t
Update using the last checkin time of the file and not the current time.
16) -W spec
This option causes the file named, spec to be filtered during update.
17) -j
Merges changes from the first specified revision to the second specified revision of the same file in the current working directory.
