The Humble Rat
The Humble Rat

Reputation: 4696

Subversion Ignore Certain Files

I realise there are a few million pages describing ignoring files and folders in SVN. I am despite the vast amount of information slowly going insane trying to get this correct.

I need to ideally create a txt file that can contains the list of ignored files and folders. This can then be svn'd so that it is carried into each new checkout.

To create a file so far I have the following:

svn propset svn:ignore -F .svnignore .

If I have say the following structure:

folder1
      folder2
             folder3
folder4
       test.php

I need to effectively ignore anything in folder3 but include folder3 itself.

I need to ignore test.php specifically from folder4 but include folder4 and any other files/folders generated

Can anyone point me in the right direction of how to achieve this.

Upvotes: 0

Views: 51

Answers (1)

Lazy Badger
Lazy Badger

Reputation: 97365

Nor

>svn pl -v
Properties on '.':
  svn:ignore
    Folder4\test.php
    Folder1\Folder2\Folder3\*.*

nor

>svn pl -v
Properties on '.':
  svn:ignore
    Folder4/test.php
    Folder1/Folder2/Folder3/*

thus: you can't operate with single file and tree-pattern in it will not work:

>svn st
 M      .
?       Folder1\Folder2\Folder3\a.txt
?       Folder1\Folder2\Folder3\b.txt
?       Folder1\Folder2\Folder3\test.php
?       Folder1\Folder2\test.php
?       Folder4\Folder5\test.php
?       Folder4\a.txt
?       Folder4\b.txt
?       Folder4\test.php

You have to add ignore patterns to the parents of ignored objects

>svn pl -v -R
Properties on 'Folder1\Folder2\Folder3':
  svn:ignore
    *.*

Properties on 'Folder4':
  svn:ignore
    test.php

in order to get needed results

>svn st --no-ignore
 M      Folder1\Folder2\Folder3
I       Folder1\Folder2\Folder3\a.txt
I       Folder1\Folder2\Folder3\b.txt
I       Folder1\Folder2\Folder3\test.php
?       Folder1\Folder2\test.php
 M      Folder4
?       Folder4\Folder5\test.php
?       Folder4\a.txt
?       Folder4\b.txt
I       Folder4\test.php

Upvotes: 2

Related Questions