Common SVN commands, super detail

Source: Internet
Author: User
Tags diff svn svn update what svn
Common SVN commands

SVN (Subversion) is a free, open source version of the project source Code control tool. At present, most open source software and enterprise code management, using SVN as a code version management software.
Subversion stores files in a central repository, which is much like a normal file server. The difference is that it can record every file and directory modification so that you can revert the data to a previous version when needed, and view the details of the changes to the data. SVN common Commands

1, checkout files to local directory
SVN checkout path ( path is a directory on the server )
Shorthand: SVN co path
2, adding a new file to the version library
SV N Add File
3, submit changed files to version Gallery
SVN commit-m "Log description" [-n] [–no-unlock] PATH (use the –no-unlock switch if you choose to keep the lock)
Short: SVN CI
4, lock/unlock
svn lock-m "Lockmessage" [–force] PATH
svn unlock PATH
5, updating to a version
svn update-r m PATH
Shorthand: SVN up
6, view file or directory status
1. SVN status path (status of files and subdirectories in the directory, normal status not shown)
?: Not in the control of SVN; M: Content modified; C: conflicting; A: scheduled to be added to version This library; K: Locked "
2" svn status-v path (show file and subdirectory status)
"The first column remains the same, the second column displays the working version number, and the third and fourth columns display the last modified version number and the modified person"
Shorthand: SVN st
Note: SVN Status, SVN diff, and SVN revert these three commands can also be performed without a network, because SVN is local. SVN retains the original copy of the local version.
7, delete files
svn delete path-m "delete test fle"
Shorthand: SVN (del, remove, RM)
8, view log
SVN log path
11, Merge the differences between two versions into the current file
svn merge-r m:n path
12, SVN help
SVN assistance
SVN aid CI svn not common commands

13, File and directory list under the version library
SVN list path shows all files and directories that belong to the version library under the path directory shorthand: SVN ls
14. Create a new directory under version control
SVN mkdir: Create a new directory under version control.
Usage:
1, mkdir PATH ...
Each directory specified with the working copy PATH is created on the local side and the new schedule is added to the next commit.
2, mkdir URL ... Create a directory for version control.
Each directory specified as a URL is created by submitting it immediately to the warehouse. 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).
Usage: revert PATH ... Note: The notebook command does not access the network and will remove the conflicting status. But it will not restore the deleted directory
16. Conflict Resolution
SVN resolved: removes the conflicting state of a working copy's directory or file.
Usage: Resolved PATH ... Note: The notebook command does not resolve the conflict by syntax or removes the conflict token; it simply removes the associated file for the conflict and then lets the PATH be resubmitted. SVN other Commands

SVN cleanup
When subversion modifies your working copy (or any information in. svn), it tries to be as secure as possible. Subversion writes its intent to a log file before changing a working copy. It then executes the commands in the log file to apply the required modifications. Finally, subversion deletes the log file. Architecturally, this is similar to a log file system (journaled filesystem). If a subversion operation is interrupted (for example, the process is killed, or the machine is dropped), the log file is still on the hard drive. Re-execute the log file, subversion can complete the previously started operation, so that your working copy can return to a reliable state.

Here's what SVN cleanup does: It searches for your working copy and executes all the remaining logs, removing the lock during this process. If subversion has told you that part of your working copy has been "locked", then you should execute this command. In addition, SVN status displays L in front of the locked item
SVN status
L Somedir
M SOMEDIR/FOO.C

SVN cleanup
SVN status
M somedir/foo.c SVN common operations table

Operation Command
Check out SVN checkout Path
Export SVN export locally checked out (that is, with an. svn folder) full path to export local directory full path
Add new File SVN add filename
Submit SVN ci-m "Submit Notes Message Text"
Update files SVN update;svn update-r fixed version filename; SVN update filename
deleting files SVN Delete file name
Lock/unlock SVN lock-m "Lock Memo info text" [–force] filename; SVN unlock filename
Compare differences SVN diff filename; svn diff-r fixed version number m: Fixed version number n filename
View file or directory status SVN St directory Path/Name
View Log SVN log filename
SVN Help SVN help<-full feature options; SVN help ci<-description of specific features
Directory listings SVN info filename
View file Details SVN list;svn ls
Restore Local modifications svn revert [–recursive] file name
Resolve Conflicts SVN resolved [local directory full path]

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.