Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude files by wildcard through Tortoise SVN shell menu

I am using Tortoise SVN 1.6.16 in Windows 7. If I have a certain file type I want to exclude from future commits, I thought I could just go find a file of that type within my working folder, then right click it, and select "TortoiseSVN->Delete and Add to Ignore List->*.ext" where ext is the file extension of the file I clicked, as shown in the image below.

However, when I do this, it only excludes that specific file, and the next time I commit, all other files of that type still come up in the list to commit.

Am I doing something wrong? How can I just tell Tortoise or SVN to ignore all files of a certain type from future commits?

enter image description here

like image 959
SSilk Avatar asked Aug 01 '11 16:08

SSilk


People also ask

How do I checkout with TortoiseSVN?

Create that folder, then right click on it and select TortoiseSVN → Checkout.... Then enter the URL to checkout, in this case file:///c:/svn_repos/trunk/Widget1 and click on OK. Our development folder is then populated with files from the repository.

How do I ignore bin and obj folder in SVN?

The text box “Global ignore pattern” defines what patterns you want to exclude; in my case I wanted to remove bin and obj folders, and ReSharper related files, which typically contain _ReSharper, so I added bin obj _ReSharper to the list of patterns. Et voila!

What does TortoiseSVN cleanup do?

This is a fast and easy way to remove all generated files in your working copy. All files and folders that are not versioned are moved to the trash bin. Note: you can also do the same from the TortoiseSVN → Revert dialog. There you also get a list of all the unversioned files and folders to select for removal.

How do I compare codes in SVN?

Go to the repository browser (<right click>/TortoiseSVN/Repo-browser/<enter URL>). Open right click menu on branch B, select 'Mark for comparison'. Then open right click menu on branch A, select 'Compare URLs' or 'Show differences as unified diff'.


3 Answers

I had the same hunch as @Stefan: that you were probably seeing files in subdirectories and thinking those should have also been ignored even though you only applied the ignore to a single folder.

So if that is in fact the case, here is the recipe:

When you want to ignore files or patterns from a single directory:

Use the convenience menu command to add to the ignore list.

When you want to ignore files or patterns from a subtree:

Open the subversion properties (TortoiseSVN >> Properties) of the root of the subtree. Add or edit an entry for the svn:ignore keyword. The illustration shows an example where I have specified to ignore an obj subfolder as well as all files with a .user or .bak extension.

enter image description here

The secret, though, is in the specification--when you define the patterns to ignore, select the recursive choice as indicated here:

enter image description here

Unfortunately, there is one catch to this method: In my example, I had previously specified to ignore obj and *.user and I was adding just the *.bak pattern. When I apply recursively, it does not apply just the change (*.bak) but everything in the svn:ignore keyword (obj, *.user, and *.bak) to all subfolders. That may or may not be what you want, so be aware of it.

like image 159
Michael Sorens Avatar answered Sep 28 '22 01:09

Michael Sorens


It ignores all bat files right, but not recursively! It only ignores them in the folder you added it to the ignore list.

like image 38
Stefan Avatar answered Sep 27 '22 23:09

Stefan


You could also use Tortoise's global ignore pattern (if it's applicable to all your working copies):

  • TortoiseSVN -> Settings
  • General
  • Fill out the "Global ignore pattern" field, such as adding "*.ext" at the end of it, separating entries with a space.
like image 23
leokhorn Avatar answered Sep 27 '22 23:09

leokhorn