Conquer SVN command line common commands

Source: Internet
Author: User

1 SVN info

Gets the basic information for the current local code base.

Take the version number of the current local code

SVN info trunk/| Awk-f ': ' {if ($ ~/^revision$/) {print $}} ' | Tr-d ""

2 SVN log

Gets the submit content for a revision. -V Displays a list of files specifically submitted for modification,-r specifies the version number.


3 svn diff

Compare the differences between the two version numbers.


4 svn checkout/update

Check out code SVN checkouthttp://127.0.0.1/repos/trunk

Update Code SVN update trunk/

5 Application Examples

Get the submission record between the version numbers before and after the update, and modify the content comparison.

#!/usr/bin/bash
 
repo=$1
 
#Save old revision
old_rev= ' svn info $repo | \
            awk-f ': ' {if ($ ~/^revision$/ ) {print $}} ' | \
            tr-d "" '
echo Old revision: $old _rev
 
#Update code
SVN Update $repo
 
#Save New revision before Te
new_rev= ' svn info $repo | \
              awk-f ': ' {if ($ ~/^revision$/) {print $}} ' | \
              tr-d ' "'
echo N EW revision: $new _rev
 
#Generate diff
if [$old _rev = = $new _rev] then
   echo No revision Commited.
  else
         svnlog-v-R $old _rev: $new _rev $repo
   svn diff-r $old _rev: $new _rev $repo
fi
reference materials

Http://www.subversion.org.cn/svnbook/1.4/svn.ref.svn.c.log.html

Http://www.subversion.org.cn/svnbook/1.2/svn.tour.history.html

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.