views:

41

answers:

3

Hi all

I just added a class library project to my .NET solution. When I built it, it created the bin and obj folders, which I want to exclude from version control.

However, Tortoise won't let me ignore the folders before the first commit. (I think it says 'Cannot add to ignore list' or something similar). I have to check the whole lot in, and then choose 'Delete and add to ignore list' for the two folders.

Am I doing something wrong here? How do I prevent them being checked in at all, and ensure Tortoise knows to ignore them?

Thanks

David

+4  A: 

Set the svn:ignore property to "bin" and "obj" for the parent folder, provided the parent folder is under version control.

  • Right-click the parent folder in Explorer
  • Choose TortoiseSVN -> Properties
  • Choose the svn:ignore property from the "Property name" drop-down
  • Add "bin" and "obj" to the "Property value" field, separating them by line breaks.
  • Commit the parent folder only
  • The child folders should show up with a grey "ignored" icon from then on.
Unicron
How do I do that using Tortoise?
David
@David I edited my answer.
Unicron
@David the parent folder needs to be under version control in this scenario by the way.
Unicron
A: 

It's because you haven't yet added their parent directories. Do 'add' on the new project directory first, and then when it gives you the dialog showing the list of files to add, untick bin and obj. You can then ignore them once the project directory has been added.

You could also add bin and obj to your global ignore list (in the TortoiseSVN prefs) though that will ignore any instances of bin across all your projects.

the_mandrill
Oh, I see. So just check the project in EXCEPT the bin and obj folders, then ignore them in the usual way. Thank you.
David
You can just add the project, and then once it's added (you don't need to commit yet) you can ignore them.
the_mandrill
A: 

you can add to your global ignore pattern.

In Tortoise settings, on the General pane, there's a edit field to add global ignore patterns. These are wildcard-enabled so you can add all the temporary files, eg *.ncb etc, but also directories.

eg. here's my global ignore pattern, you can see it's set to ignore many file types but also a couple of directories.

*.dep *.aps *.vbw *.suo *.obj *.ncb *.plg *.bsc *.ilk *.exp *.sbr *.opt *.pdb *.idb *.pch *.res *.scc *.vspscc *\bin\Release *\Debug *\obj *.user BuildLog.htm *.cache *.log *.dep *.intermediate.manifest *ReSharper*
gbjbaanb