Linux Install SVN client subversion and how to use it

Source: Internet
Author: User
Tags bz2 diff prev svn svn client svn update

1. download [[email protected] software]$ wget http://subversion.tigris.org/downloads/subversion-deps-1.6.12.tar.bz2[[ Email protected] software]$ wget http://subversion.tigris.org/downloads/subversion-1.6.12.tar.bz2
2. unzip [[email protected] software]$ tar jxvf subversion-deps-1.6.12.tar.bz2[[email protected] software]$ tar JXVF subversion-1.6.12.tar.bz2
3. Ready to install [[email protected] software]# Mkdir/usr/local/subversion[[email protected] software]# CD subversion-1.6.12
4, installation [[email protected] subversion-1.6.12]#./configure--prefix=/usr/local/subversion[[email protected] subversion-1.6.12]# make && make install
5. Test complete [[email protected] subversion-1.6.12]# Cd/usr/local/subversion/bin[[email protected] bin]# ll
Total 1348
-rwxr-xr-x 1 root root 7007 Dec 11:12 apr-1-config
-rwxr-xr-x 1 root root 6510 Dec 11:12 apu-1-config
-rwxr-xr-x 1 root root 1840 Dec 11:12 neon-config
-rwxr-xr-x 1 root root 640714 Dec 11:12 svn
-rwxr-xr-x 1 root root 111254 Dec 11:12 svnadmin
-rwxr-xr-x 1 root root 69421 Dec 11:12 svndumpfilter
-rwxr-xr-x 1 root root 137177 Dec 11:12 Svnlook
-rwxr-xr-x 1 root root 229281 Dec 11:12 svnserve
-rwxr-xr-x 1 root root 107874 Dec 11:12 svnsync
-rwxr-xr-x 1 root root 25042 Dec 11:12 svnversion

6, establish a soft connection [[email protected]/]# LN/USR/LOCAL/SUBVERSION/BIN/SVN/SBIN/SVN 7, installation Error

Checking for APR ... no
Configure:error:APR not found. Please read the documentation

Workaround:

1. Download the required packages:

    1. wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz
    2. wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz
    3. wget Http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip

2. Compile and install:

    1. Yum Remove apr-util-devel Apr apr-util-mysql apr-docs apr-devel apr-util Apr-util-docs

The steps are as follows:

A: Solve Apr not found problem >>>>>>

    1. [Email protected] test]# TAR-ZXF apr-1.4.5.tar.gz
    2. [Email protected] test]# CD apr-1.4.5
    3. [Email protected] apr-1.4.5]#/configure --prefix=/usr/local/apr
    4. [[email protected] apr-1.4.5]# make && make install

B: Solve apr-util not found problem >>>>

  1. [Email protected] test]# TAR-ZXF apr-util-1.3.12.tar.gz
  2. [Email protected] test]# CD apr-util-1.3.12
  3. [Email protected] apr-util-1.3.12]#/configure --prefix=/usr/local/apr-util-with- apr=/usr/local/apr/bin/ Apr-1-config
  4. [[email protected] apr-util-1.3.12]# make && make install

  5. Lack of SQLite

    [[email protected] apr-util-1.3.12] #wget http://www.sqlite.org/sqlite-amalgamation-3.6.13.tar.gz

      1. [Email protected] test]# TAR-ZXF sqlite-amalgamation-3.6.13.tar.gz
      2. [Email protected] test]# CD sqlite-amalgamation-3.6.13
      3. [Email protected] apr-util-1.3.12]#/configure --prefix=/usr/local/SQLite
      4. [[email protected] apr-util-1.3.12]# make && make install
  6. When you finally compile Apache, add:

    --with-apr=/usr/local/apr

    --with-apr-util=/usr/local/apr-util

    --with-pcre=/usr/local/sqlite

    Successful compilation completed ~

    Command Usage Tutorials

1. Checkout files to a local directory
        svn Checkout Path (path is a directory on the server)

        Example: SVN checkout Svn://192.168.1.1/pro/domain

        shorthand: SVN co

2. Add a new file to the repository
        svn Add File

        Example: SVN add test.php (add test.php)

        svn add *.php (Add all php files in the current directory)

3. Submit the changed files to the repository
        svn commit-m "LogMessage" [-n] [--no-unlock] PATH (use –no-unlock switch if hold lock is selected)

        Example: SVN commit-m "Add test file for my test" test.php

        shorthand: svn ci

4. Locking/Unlock
        svn lock-m "Lockmessage" [--force] PATH

        Example: SVN lock-m "lock test File" test.php

        svn unlock PATH

5. Update to a version
        svn update-r m path

        For example:

        SVN Update If there is no directory behind it, the default is to update all files in the current directory and subdirectories to the latest version.

        svn update-r test.php (restore file test.php from repository to version)

        SVN update test.php (updated, sync in Repository.) If the prompt expires at the time of submission, it is because of the conflict, you need to update, modify the file, then clear the SVN resolved, and then commit the commit)

        shorthand: SVN
    up

6. View file or directory status
        1) SVN status path (status of files and subdirectories under directory, normal status not shown)

        "?: Not in SVN control; M: Content modified; C: conflict; A: Scheduled to be added to Repository; K: Locked"

        2) SVN status-v path (show file and subdirectory status)

    The
        first column remains the same, the second column shows the work version number, and the third and fourth columns show the last modified version number and the modified person.

        Note: The SVN status, SVN diff, and SVN revert three commands can be executed without a network, because SVN retains the original copy of the local version in. svn.

        shorthand: SVN st

7. Delete Files
        svn delete path-m "delete test fle"

        Example: SVN delete svn://192.168.1.1/pro/domain/test.php-m "Delete test file"

        or go directly to svn delete test.php and then svn ci-m ' delete test file ', which we recommend using this

        shorthand: SVN (del, remove, RM)

8. View Logs
        SVN log path

        For example: SVN log test.php shows all changes to this file, and its version number

9. View File Details
        SVN info Path

        Example: SVN info test.php

10. Compare Differences
        svn diff path (compares the modified file to the base version)

        example: SVN diff test.php

        svn diff-r m:n Path (difference between version m and version N)

        Example: SVN diff-r 200:201 test.php

        shorthand: svn di

11. Merge the differences between the two versions into the current file
        svn merge-r m:n path

        For example: SVN merge-r 200:205 test.php (the difference between version 200 and 205 is merged into the current file, but generally conflicts occur and need to be addressed)

12. SVN Help
        SVN
    Help

        svn help CI

        ——————————————————————————

    The
        above is a common command, the following write a few common

        ——————————————————————————

13. List of files and directories under the repository
        SVN list Path

        displays all files and directories belonging to the repository under the path directory

        shorthand: SVN ls

14. Create a new directory under version control
        svn mkdir: Create a new directory under the included version control.

        usage: 1, mkdir PATH ...

        2. mkdir URL
    ...

        Create a version-controlled directory.

        1. Each directory specified in the working copy PATH will be created on the local side and added

        scheduled to be submitted for the next time.

        2. Each directory specified in the URL will be created by submitting it to the repository immediately.

        in both cases, all intermediate directories must exist beforehand.

15. Restore Local Modifications
        svn revert: Restores the original unchanged working copy file (restores most of the local modifications). revert:

        usage: revert PATH ...

        Note: The notebook command will not access the network and will release the conflicting condition. But it won't recover
    .

        directories that were deleted

16. Code Base URL Change
        SVN switch (SW): Updates the working copy to a different URL.

        usage: 1, switch URL [PATH]

        2. Switch–relocate from to [PATH ...]

        1, update your working copy, map to a new URL, its behavior is similar to "SVN update", will also

    The
        files on the server are merged with the local files. This is the one where the working copy corresponds to a branch or tag in the same warehouse.

        method.

        2, rewrite the working copy of the URL metadata to reflect the simple URL changes. When the root URL of the warehouse changes

        (such as scheme name or host name change), but the working copy is still used when mapping to the same directory in the same warehouse

        This command updates the correspondence between the working copy and the warehouse.

17. Conflict Resolution
        SVN resolved: Removes the "conflicting" status of the working Copy's directory or file.

        usage: Resolved PATH ...

        Note: The book command does not resolve the conflict by syntax or remove the conflict token; it simply removes the conflicting

        file, and then allow PATH to submit again.

18. Output the contents of the specified file or URL.
        svn cat Target [@ VERSION] ... If a version is specified, the lookup starts from the specified version.

        svn cat-r PREV filename > filename (PREV is the previous version, you can also write a specific version number so that the output can be submitted)

Linux Install SVN client subversion and how to use it

Related Article

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.