← All articles

SubVersion / TortoiseSVN Global Ignore Pattern

TortoiseSVN's Global Ignore Pattern setting keeps bin, obj, dll, pdb, and other build junk out of source control - here's the exact pattern I use and why.

Donn Felker

Donn Felker

2007.08.10 · 2 min read

**** Update: 20090316  **** 

 I have changed my pattern to this: */bin */obj *.bak *.*scc *.user *.suo *.webinfo bin obj *.csproj.user *.resharper.user *.resharper *.suo *.cache /Build _ReSharper.*

*****END Update ***** 

A nice feature of TortoiseSVN that is often ignored is the Global Ignore Pattern. It allows your Tortoise client to ignore certain file types during the check in/update process.

I’ve worked at a few companies  who actually check in everything, including the kitchen sink. The teams would check in all dll’s, exe’s, pdb’s, bin folders, compiled web site folders, everything. In my opinion, those files should never be in source control (with  a few minor exceptions).

Reasoning

Source control is just that – “Source Control”. Is that compiled dll for your business layer object really “source”? No, its a binary file that has compiled code in it. Is that PDB really a source file? No. Its a file that assists with debugging. Is that exe really a source file? No, its a compiled application. These SHOULD NOT be in your source control.

Exceptions

The exceptions to this rule are when you use third party components. For example, maybe  you use a product such as MBUnit, NCover, NDepend, or Infragistics. These are dll’s that your application must reference to perform a certain duty. At this point, having a dll or exe in your source is completely fine (IMO).

How to set your global ignore pattern

To set your global ignore pattern (with TortoiseSVN) right click Windows Explorer –> TortoiseSVN –> Settings.

Tortoise1

Once you click  on settings enter your global ignore pattern.

Tortoise2

My Global Ignore  Pattern 

The global ignore pattern I use is: */bin */obj *.bak *.*scc *.user *.suo *.webinfo bin obj *.dll *.pdb *.exe

I’m blocking everything in my bin folder, obj folder, anything that may have been named *.bak, user files, suo files webinfo dll’s and pdb and exe files.

If I need to check in a 3rd party component (which is rare). I’ll remove the pattern, paste it into Notepad++ to save it temporarily. Then I’ll check in the third party component by selecting it exclusively and checking it in.  Then I’ll re-add my global ignore pattern.

Now your source control can be free and clear of code clutter.

Donn Felker

Written by Donn Felker

I've spent 25+ years shipping software, writing books, and running my own companies. I write about thinking clearly, working for yourself, and doing real work while AI rewrites the rules. New essays land here every week.

Get the newsletter

Keep reading