SVN: Ignore subfolders
Asked Answered
C

2

21

I have a folder say: /user_files, which I want to include in SVN, but there are additional folders underneath it which I don't want to include.

Is there a way to use svn:ignore to ignore anything in a folder even if that parent folder is included in the repos?

Crispa answered 3/2, 2011 at 17:20 Comment(0)
S
25

Use this to ignore everything in the user_files directory:

svn propset svn:ignore '*' user_files

This sets the svn:ignore property to * on the user_files directory, which effectively causes svn to ignore every untracked file in this directory.

Then you have to commit the directory on which you set the property, and update other working copies.

Sponge answered 3/2, 2011 at 17:24 Comment(4)
Sweet thanks. If I do propset on a server, do I also need to do it on my local machine?Crispa
BTW if I run: svn propset svn:ignore graphic_novel_images '' I get '' is not under version controlCrispa
You need to do it on a working copy of the repository (a checkout for the repository); then commit that directory. Then every up-to-date working copy (including the one on your local machine) will have to property too.Sponge
do svn propset svn:ignore '*' graphic_novel_imagesSponge
H
6

.svnignore doesn't stop you from adding things - it just suppresses them being reported in svn stat. You could put /user_files in your .svnignore and then force-add the things you want to add from there.

Homoeroticism answered 3/2, 2011 at 17:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.