SVN installation--linux Environment

Source: Internet
Author: User
Tags diff svn svn update

Download: http://subversion.tigris.org

Current date stable version SVN1.32 http://subversion.tigris.org/downloads/subversion-1.3.2.tar.gz

Installation:

Unzip: #: Tar zxvf subversion-1.3.2.tar.gz

Enter./configure, make, and sudo made install to complete the compilation.

Turn on SVN service: svnserve-d

Check whether the service is turned on: NETSTAT-NTLP if you see 3690 of the ports are normally open, it proves that SVN is up. Formal use: First we have to build an SVN project, and people generally think that building a project requires only one file, and before I use SVN for the first time, there is the idea that the SVN build project needs to create a folder

Create a Project command: svnadmin create project_name project_name is your project name and can be taken arbitrarily. After the setup is complete, Project_Name is a folder that goes into the folder and can see a conf folder. Access to the folder can see 2 files (if there is no passwd file, you can create with VI), edit svnserve.conf anon-access = read, auth_access = write and password-db = passwd comments to and the notes of [general] are also removed. VI passwd file, if it is a new file, enter: [user] your_name = your_password The your_name set here is your username, Your_password is your password, this is the necessary pass to access SVN.

Well, now that the preparation is finished, the following can be used. First find your project source code folder, using the following command: CD your project in your project dircetory use:svn co/home/project_name--username = your_name--pa Ssword=your_password

OK, now you can use the following command on the client computer to get the project source code file you want SVN co svn://home/project_name--username=your_name--password = Your_password

Add add svn file to SVN library: svn add/home/your_project/*.*--username=your_name--password = Your_password

Submit file: SVN commit/home/your_project/*.*--username=your_name--password=your_password

Update file: SVN update/home/your_project/*.*--username=your_name--password=your_password

Of course you can edit a script file to do all the work at once: VI svnupdate.sh

#!/bin/sh svn add/home/your_project/*.*--username=your_name--password = Your_password svn commit/home/your_project/* . *--username=your_name--password=your_password svn update/home/your_project/*.*--username=your_name--password= Your_password

chmod +x svnupdate.sh

Finish

Common commands

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--username Qinxiaohui

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 the file test.php in the repository to version 200)

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 to map to a new URL that behaves like SVN update and merges the file on the server with the local file. This is the method that corresponds a working copy to a branch or tag in the same warehouse.

2, rewrite the working copy of the URL metadata to reflect the simple URL changes. When the repository's root URL changes (such as scheme name or hostname change), but the working copy is still mapped to the same directory as the same repository, use this command to update the corresponding relationship 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 allows PATH to commit 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)

Original address: http://www.cnblogs.com/nameliu/archive/2012/12/04/2801280.html,http://hi.baidu.com/ops_bd/blog/item/ 70c51d2d624dc184023bf6ed.html

SVN installation--linux Environment

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.