Ignoring files/folders when committing to SVN repository

This feature of SVN is very handy. After you build your projects, there will be dlls in bin folders etc which you don’t want to commit.

Using svn:ignore property of SVN, you can eliminate the possibility of committing those files!

image

As many other things, I learnt this from NH :)


Posted 07-03-2009 3:43 PM by Tuna Toksoz

[Advertisement]

Comments

Derik Whittaker wrote re: Ignoring files/folders when committing to SVN repository
on 07-03-2009 8:48 AM

Yea, this is a slick little feature.  We have a standard set of ignore values we use for all devs on our team

Dathan wrote re: Ignoring files/folders when committing to SVN repository
on 07-03-2009 10:45 AM

My standard ignore set is

bin

obj

*.suo

And then I add extras as appropriate to the project.  Helpful hint: if you're using SVN via the command line and edit the svn:ignore property using, e.g., Notepad, keep in mind that it uses each line as the match pattern, *including trailing spaces*.  That one's bitten me before.

Jose wrote re: Ignoring files/folders when committing to SVN repository
on 07-04-2009 2:30 PM

Hi Tuna I will share with you one of my secrets.

If you are using "TortoiseSVN", when starting a new project is very complicated to "remove" these files/directorys for the first commit. I commit "EVERYTHING" in the first commit and then in the explorer I pick those unnecesary folder and "righ click holding SHIFT" then you gonna se an option "DELETE (keep local)"!!! This feature is really cool.. You can do a second commit to delete and ignore those unwanted folders.

KevDog wrote re: Ignoring files/folders when committing to SVN repository
on 07-08-2009 10:28 AM

How do you write the property to ignore all bin folders in a solution? Do you need to set the "apply recursively" flag and just put 'bin' and 'obj' in the string?

Tuna Toksoz wrote re: Ignoring files/folders when committing to SVN repository
on 07-08-2009 10:33 AM

I'd do that.

Thomas G Mayfield wrote re: Ignoring files/folders when committing to SVN repository
on 07-10-2009 2:33 PM

Easier still is to set your system-wide ignores. You'll be hitting the same ones over and over again on most every project, as will the other developers. If you make the setting global for your machine (rather than stored in the repository), you can stop worrying about any of those whenever you do any operation.

For TortoiseSVN, right-click in any Explorer window and go to TortoiseSVN > Settings. On the General page, put your ignores under the "Global ignore pattern", separated by spaces.

Where I use both Tortoise and command-line SVN, I hit the "Edit" button below that, locate and uncomment the # global-ignores directive, and set my values there instead.

As a Resharper user, my pattern is a bit different, as well as having special excludes for logs and backup files, but:

global-ignores = _ReSharper* bin obj *.suo *.cache *.[Bb][Aa][Kk] *.user *.log* *.resharper

Tuna Toksoz wrote re: Ignoring files/folders when committing to SVN repository
on 07-10-2009 2:51 PM

Doing both will provide the best solution. In case any developer in the team forgets to set their ignores, even then the repo will be safe.

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
Umbraco
NServiceBus
RavenDb
Web Sequence Diagrams
Ducksboard<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)