Understanding SVN keywords base, Head, committed, Prev

Source: Internet
Author: User
Tags svn update

SVN uses the version number to record every change to the version library. General SVN operations do not need the version number, but some SVN operations need to specify the version number. We can specify a specific integer version number, but we can also use the svn keyword to refer to a special version number. SVN will actually calculate the actual integer version number it refers:

Head: the latest version in the version library;

Base: version of a work copy item. Note that this is the version number when you last update the item, which may be later than the latest version number;

Committed: the latest version of a work copy item, which is the same as or earlier than the base;

PREV: committed-1.

Head is for version libraries, and the other three are for a working copy directory or file.

Example:

$ SVN diff-r PREV: committed Foo. c
# Shows the last change committed to foo. c

$ SVN log-r head
# Shows Log message for the latest repository commit

$ SVN diff-r head
# Compares your working copy (with all of its local changes) to the latest version of that tree in the repository

$ SVN diff-r base: Head Foo. c
# Compares the unmodified version of foo. C with the latest version of foo. c In the Repository

$ SVN log-r base: Head
# Shows all commit logs for the current versioned directory since you last updated

$ SVN update-r Prev Foo. c
# Rewinds the last change on foo. C, decreasing Foo. C's working Revision

$ SVN diff-r base: 14 Foo. c
# Compares the unmodified version of foo. C with the way Foo. c looked in revision 14

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.