Go to the first, previous, next, last section, table of contents.

## Sticky tags

The ``-r release-1-0-patches'` flag that was given to `checkout` in the previous example is sticky, that is, it will apply to subsequent commands in this directory. If you commit any modifications, they are committed on the branch. You can later merge the modifications into the main trunk. See section Merging.

You can use the `status` command to see what sticky tags or dates are set:

    $ vi driver.c   # Fix the bugs
    $ cvs commit -m "Fixed initialization bug" driver.c
    Checking in driver.c;
    /usr/local/cvsroot/yoyodyne/tc/driver.c,v  <--  driver.c
    new revision: 1.7.2.1; previous revision: 1.7
    done
    $ cvs status -v driver.c
    ===================================================================
    File: driver.c          Status: Up-to-date

        Version:            1.7.2.1 Sat Dec  5 19:35:03 1992
        RCS Version:        1.7.2.1 /usr/local/cvsroot/yoyodyne/tc/driver.c,v
        Sticky Tag:         release-1-0-patches (branch: 1.7.2)
        Sticky Date:        (none)
        Sticky Options:     (none)

        Existing Tags:
            release-1-0-patches             (branch: 1.7.2)
            release-1-0                     (revision: 1.7)

The sticky tags will remain on your working files until you delete them with ``cvs update -A'`. The ``-A'` option retrieves the version of the file from the head of the trunk, and forgets any sticky tags, dates, or options.

Sticky tags are not just for branches. For example, suppose that you want to avoid updating your working directory, to isolate yourself from possibly destabilizing changes other people are making. You can, of course, just refrain from running `cvs update`. But if you want to avoid updating only a portion of a larger tree, then sticky tags can help. If you check out a certain revision (such as 1.4) it will become sticky. Subsequent `cvs update` will not retrieve the latest revision until you reset the tag with `cvs update -A`. Likewise, use of the ``-D'` option to `update` or `checkout` sets a sticky date, which, similarly, causes that date to be used for future retrievals.

Many times you will want to retrieve an old version of a file without setting a sticky tag. The way to do that is with the ``-p'` option to `checkout` or `update`, which sends the contents of the file to standard output. For example, suppose you have a file named ``file1'` which existed as revision 1.1, and you then removed it (thus adding a dead revision 1.2). Now suppose you want to add it again, with the same contents it had previously. Here is how to do it:

    $ cvs update -p -r 1.1 file1 >file1
    ===================================================================
    Checking out file1
    RCS:  /tmp/cvs-sanity/cvsroot/first-dir/Attic/file1,v
    VERS: 1.1
    ***************
    $ cvs add file1
    cvs add: re-adding file file1 (in place of dead revision 1.2)
    cvs add: use 'cvs commit' to add this file permanently
    $ cvs commit -m test
    Checking in file1;
    /tmp/cvs-sanity/cvsroot/first-dir/file1,v  <--  file1
    new revision: 1.3; previous revision: 1.2
    done
    $

Go to the first, previous, next, last section, table of contents.