Svn command line batch deletion and batch Addition

Source: Internet
Author: User


Svn command line batch Delete and batch add If svn command line is used, for example, in a linux terminal, the svn add command for www.2cto.com is svn add, and the DELETE command is svn del, however, there is a lack of batch operations. If I manually add a variety of files under Multiple folders in the resource manager, and then I want to add files at one time, svn will not be able to work, even if svn add * is used, all files under the parent directory are ignored because the parent directory of the newly added file has been added to the version library. A lot of files are manually deleted, and a similar situation occurs when you want to delete del once. Through research, we found that the following commands can solve these two problems: Batch delete files -- svn status | grep! | Awk '{print $2}' | definition of xargs svn del statement: First, check the svn status to list all changes! The number of deleted files is not marked as removed from the database, grep! Detach these files separately. If you do not execute the following statement, the displayed content is similar! Img/p/2-49-small.jpg! Img/p/2-48-thickbox.jpg! Img/p/2-48-medium.jpg www.2cto.com and then use awk '{print $2}' to process the extracted text results, leaving the second line of text in each line, that is, the name of the subsequent file. Note that, svn status | grep! And the following statement | awk '{print $2}' | xargs svn del, there must be a space, otherwise the terminal will still think this! The result displayed here is img/p/2-49-small.jpgimg/p/2-48-thickbox.jpgimg/p/2-48-medium.jpg, which can be directly submitted to the svn del command, use the xargs parameter to construct the command and provide the text of each line to svn del as the parameter. The result is that all the listed files are executed del once. Batch add files-almost the same. The difference is that svn mark symbols are different and question marks are used! Svn status | grep? | Awk '{print $2}' | xargs svn add

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.