add an element to the default group of a workspace


accurev anchor [ -c <comment> ] [ -E <value(s)> ] [ -R ]
[ -n [ -O ] ] { -l <list-file> | <element-list> }


The anchor command is essentially the same as the co (check out) command. It adds elements to the workspace’s default group, thus preventing them from being changed by an update command. (The anchor keeps the file from being “swept away”— that is, overwritten — during an update.)

anchor always checks out the version in your workspace stream; thus, it never overwrites the file in your workspace with an old version of the element. By contrast, the co command supports the -v and -t options; this checks out an old version and overwrites the file in your workspace with a copy of that version.

A typical use of anchor is after an update command complains about unanchored files. Anchoring all such files enables a subsequent update to succeed.

Exclusive File Locking and Anchor-Required Workspaces

See File Locking in Workspaces.

Undoing an ‘anchor’ Command

You can undo an anchor command by issuing a purge command. This removes the element(s) from the workspace’s default group. But be careful — purge also discards any changes you may have made to the file(s) since anchor’ing them.


–c <comment>

Specify a comment for the transaction. The next command-line argument should be a quoted string. Alternatively, the next argument can be in the form @<comment-file>, which uses the contents of text-file <comment-file> as the comment.

-E <value(s)>

Change the exclusive file locking state for this element: serial or parallel. See File Locking in Workspaces.


Select only modified elements that are not already in the default group.


When used with the -n option, overrides timestamp optimization. When -O is used, all files are considered, even those whose modification times have not changed since the last time the workspace was updated or searched for modified files. Having to check all files, regardless of modification time, slows anchor performance. In anchor-required workspaces, overrides the warning message encountered when operating on an element that is active in a sibling workspace.


Recurse into subdirectories.

-l <list-file>

Process the elements listed in <list-file>. This must be a text file, with one element name per line. Extra whitespace is not allowed; make sure there are no empty lines and no leading or trailing white space around the filenames. Wildcards are not expanded. There is no provision for comment lines in the file.

If you use this option, any <element-list> specified is silently ignored.


One or more element names, separated by whitespace. If you also specify a <list-file> using the –l option, this <element-list> is silently ignored.


Anchor all the modified files in the workspace that are not already in the default group:

   > accurev anchor -n

Anchor two particular files:

   > accurev anchor blue.c red.c

See Also

co, revert

Techniques for Selecting Elements in the AccuRev CLI Guide.