update [-ACdflPpR] [-I name] [-j rev [-j rev]] [-k kflag] [-r tag|-D date] [-W spec] files…
Requires: repository, working directory.
Changes: working directory.
After you've run checkout to create your private copy of source from the common repository, other developers will continue changing the central source. From time to time, when it is convenient in your development process, you can use the update command from within your working directory to reconcile your work with any revisions applied to the source repository since your last checkout or update.
These standard options are available with update (通用命令选项, for a complete description of them):
Use the most recent revision no later than date. This option is sticky, and implies -P. See 粘性的标签(Sticky tags) 在 第 4 章, for more information on sticky tags/dates.
Only useful with the -D date or -r tag flags. If no matching revision is found, retrieve the most recent revision (instead of ignoring the file).
Process keywords according to kflag. See 第 12 章. This option is sticky; future updates of this file in this working directory will use the same kflag. The status command can be viewed to see the sticky options. See 附录 B, for more information on the status command.
Local; run only in current working directory. 第 6 章.
Prune empty directories. See 移动和重命名目录 在 第 7 章.
Pipe files to the standard output.
Update directories recursively (default). 第 6 章.
Retrieve revision/tag rev. This option is sticky, and implies -P. See 粘性的标签(Sticky tags) 在 第 4 章, for more information on sticky tags/dates.
These special options are also available with update.
Reset any sticky tags, dates, or -k options. See 粘性的标签(Sticky tags) 在 第 4 章, for more information on sticky tags/dates.
Overwrite locally modified files with clean copies from the repository (the modified file is saved in .#file.revision, however).
Create any directories that exist in the repository if they're missing from the working directory. Normally, update acts only on directories and files that were already enrolled in your working directory.
This is useful for updating directories that were created in the repository since the initial checkout; but it has an unfortunate side effect. If you deliberately avoided certain directories in the repository when you created your working directory (either through use of a module name or by listing explicitly the files and directories you wanted on the command line), then updating with -d will create those directories, which may not be what you want.
Ignore files whose names match name (in your working directory) during the update. You can specify -I more than once on the command line to specify several files to ignore. Use -I ! to avoid ignoring any files at all. 使用 cvsignore 忽略某些文件 在 附录 C, for other ways to make cvs ignore some files.
Specify file names that should be filtered during update. You can use this option repeatedly.
spec can be a file name pattern of the same type that you can specify in the .cvswrappers file. cvswrappers文件 在 附录 C.
With two -j options, merge changes from the revision specified with the first -j option to the revision specified with the second j option, into the working directory.
With one -j option, merge changes from the ancestor revision to the revision specified with the -j option, into the working directory. The ancestor revision is the common ancestor of the revision which the working directory is based on, and the revision specified in the -j option.
Note that using a single -j tagname option rather than -j branchname to merge changes from a branch will often not remove files which were removed on the branch. 合并能添加和删除文件 在 第 5 章, for more.
In addition, each -j option can contain an optional date specification which, when used with branches, can limit the chosen revision to one within a specific date. An optional date is specified by adding a colon (:) to the tag: -jSymbolic_Tag:Date_Specifier.
update and checkout keep you informed of their progress by printing a line for each file, preceded by one character indicating the status of the file:
The file was brought up to date with respect to the repository. This is done for any file that exists in the repository but not in your source, and for files that you haven't changed but are not the most recent versions available in the repository.
Like U, but the cvs server sends a patch instead of an entire file. This accomplishes the same thing as U using less bandwidth.
The file has been added to your private copy of the sources, and will be added to the source repository when you run commit on the file. This is a reminder to you that the file needs to be committed.
The file has been removed from your private copy of the sources, and will be removed from the source repository when you run commit on the file. This is a reminder to you that the file needs to be committed.
The file is modified in your working directory.
M can indicate one of two states for a file you're working on: either there were no modifications to the same file in the repository, so that your file remains as you last saw it; or there were modifications in the repository as well as in your copy, but they were merged successfully, without conflict, in your working directory.
cvs will print some messages if it merges your work, and a backup copy of your working file (as it looked before you ran update) will be made. The exact name of that file is printed while update runs.
A conflict was detected while trying to merge your changes to file with changes from the source repository. file (the copy in your working directory) is now the result of attempting to merge the two revisions; an unmodified copy of your file is also in your working directory, with the name .#file.revision where revision is the revision that your modified file started from. Resolve the conflict as described in 冲突示例 在 第 10 章. (Note that some systems automatically purge files that begin with .# if they have not been accessed for a few days. If you intend to keep a copy of your original file, it is a very good idea to rename it.) Under vms, the file name starts with __ rather than .#.
file is in your working directory, but does not correspond to anything in the source repository, and is not in the list of files for cvs to ignore (see the description of the -I option, and 使用 cvsignore 忽略某些文件 在 附录 C).