The SVN command tips for Ubuntu use

Source: Internet
Author: User
Tags svn

Note:
[SVN path]: The absolute path of the server to replace the branch of the Code
[path]: refers to the relative path of the terminal relative to the current folder, assuming it is under the current folder. Just omit the path.


①. Take the Svnserver code:

SVN co [svn Path]


②. View the SVN status of the current folder:

SVN St


③. View the SVN status of a folder:

SVN St [Path]dirname


④. To view a file's change history on SVN:

SVN log [path]filename


⑤. View recent n changes to a file/folder on SVN (n must be an integer greater than 0):

SVN log [path]filename/dirname-l n


⑥. View recent N-Commit information for a file/folder on SVN (including which files are modified):

SVN log [path]filename/dirname-l n-v


⑦. View the files involved in a change to an SVN number:

SVN log-v-R r949


⑧. View the two changes recorded on SVN for a file (with different content, the record content before the colon is displayed as-; followed by +):

svn di [path]filename-r r1:r2


⑨. Look at the difference between a file and SVN:

svn di [path]filename


⑩. Adding a file:

SVN Add [path]filename


11. Delete a file:

SVN rm [Path]filename


12. Add a directory:

SVN add [Path]dirname--no-ignore


13. Delete the directory:

SVN rm [PATH]DIRNAME-RF


14. A new file (only new files) is added to a directory (with. so files). Preferably back plus keyword--no-ignore):

SVN add $ (SVN st [Path] | awk ' {print $} ')
SVN add $ (SVN st [Path] | grep "?

" | awk ' {print $} ')


15. Delete a subset of files (only deleted files) under a directory:

SVN rm $ (SVN st [Path] | awk ' {print $} ')


16. Clean up the folders and subfolders of the new copy below to all. SVN folder

Find [Path]dirname-name ". SVN" | Xargs rm-rf
RM ' Find [path]dirname-name. SVN '-RF


17. Submit to Server:

svn ci [path]filename [path]dirname-m] Changed notes "


18. Assuming that the file name contains the character "@", svn add or svn rm should be added at the end with an "@" character to be able to identify the corresponding instruction:

svn add [email protected][email protected]
SVN rm [email protected][email protected]

19,grep filtering. svn files
Open ~/.BASHRC (This is bash's current user profile) and add one at the top of the file:
Export grep_options= "--EXCLUDE-DIR=\.SVN"
(Note that there can be no spaces before and after.) Otherwise, an error will be prompted when loading the configuration file)
Save and close, at the same time, type the following command at the command line, for example:
SOURCE ~/.BASHRC (Let bash read the script again)

How to use 20.patch synchronous code
To generate a synchronous code file package:
svn di > Xxx.patch
Changes to the merge code package:
Patch-p0 < Xxx.patch

The SVN command tips for Ubuntu use

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.