Linux command line under SVN ignore ignore file or folder usage

Source: Internet
Author: User
Tags svn

One, ignoring a single directory

1. Ignore folders

If the directory oa.youxi.com is from SVN checkout, add material to the server's local directory, but do not want to add material to version control, so we need to ignore this directory
First use the SVN status command to view the current status
[[Email protected] oa.youxi.com]# SVN status
? Htdocs/admin/adv/material

Add a directory that you want to ignore, which seems to have to enter the directory
[Email protected] oa.youxi.com]# CD htdocs/admin/adv/
[[Email protected] adv]# svn propset svn:ignore ' material '.
Property ' Svn:ignore ' Set on '. '

[[Email protected] adv]# svn ci-m ' ignore a directory called ' material '. '
Sending ADV
Committed Revision 2.

View status again
[[Email protected] adv]# SVN status
[Email protected] adv]#

Thereafter, no matter how the material directory is modified, it will not be submitted to the warehouse.

2. Submit folder, ignore contents in folder

[[Email protected] adv]# svn propset svn:ignore ' * ' Material
[Email protected] adv]# svn ci-m ' adding "material" and ignore its contents. '

3, if you have created a folder, and added version control, now want to ignore this folder, but to keep the contents of the folder:

[Email protected] adv]# SVN export material material-tmp
[Email protected] adv]# SVN RM material
[Email protected] adv]# svn ci-m ' removing inadvertently added directory "material". '
[Email protected] adv]# MV material-tmp material
[[Email protected] adv]# svn propset svn:ignore ' material '.
[[Email protected] adv]# svn ci-m ' ignoring a directory called ' material '. '

For non-versioned versions, it can be set directly to ignore, but cannot be done for files and directories added to version control. The solution is to first delete the Ignore, the above command is actually this way, but there is the process of exporting and MV.

Second, ignoring multiple directories

If more than one directory needs to be deleted, directory by the above steps, then the operation is completed, the previous operation of the directory execution SVN St will be displayed again? State, and the last execution of the directory is not displayed, so that the front of the directory is white.
If you have multiple directories that you need to ignore at the same time,

[[Email protected] adv]# SVN St
? Ad
? Material
? Logs
? Images
[[Email protected] adv]# SVN delete url-m= "Delete ad" #删除版本库相应目录
[Email protected] adv]# MV AD material logs images/tmp #先备份
[[Email protected] adv]# svn propset svn:ignore ". Svnignore
> Ad
> Material
> Logs
> Images
> "./
Property ' Svn:ignore ' Set on '. '
[[Email protected] adv]# svn propget svn:ignore.
. svnignore
Ad
Material
Images
Logs

[[Email protected] adv]# svn ci-m "Ignore some directory"
Sending ADV

Committed revision 6.
[[Email protected] adv]# SVN St
[[email protected] adv] #mv/tmp/{ad,images,logs,material}./#恢复备份

Here you are done, no matter how to modify the above several directories inside the file SVN St will not be listed, no matter how the SVN up current directory, the above several directories will not be affected.

Linux command line under SVN ignore ignore file or folder usage

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.