18

I use TortoiseSVN 1.7.9.

How can I ignore / remove contents from /bin folder when I svn commit the project folder? I don't want to commit files such as .dll, .pdb, etc.

I put .dll .pdb entry in svn:ignore property but it does not work and these files still show up in the list when I perform a commit.

I don't use command line client. In Windows Explorer I right-click on root project folder and click commit in TortoiseSVN context menu.

bahrep
  • 29,961
  • 12
  • 103
  • 150
Anil Soman
  • 2,443
  • 7
  • 40
  • 64
  • 3
    You could add bin folder to ignore list. Right click on the bin folder -> TortoiseSVN -> Unversion and add to ignore list -> bin. – Felipe Oriani Oct 16 '12 at 11:39

4 Answers4

24

You can find the answer in the TortoiseSVN manual and SVNBook.

TortoiseSVN Manual tells us:

If the files are already in the repository, they have to be deleted from the repository and added to the ignore list. Fortunately TortoiseSVN has a convenient shortcut for doing this. TortoiseSVN → Unversion and add to ignore list will first mark the file/folder for deletion from the repository, keeping the local copy. It also adds this item to the ignore list so that it will not be added back into Subversion again by mistake. Once this is done you just need to commit the parent folder.

See the important note from SVNBook; it explains the behavior and "why it does not work" in your case.

Subversion's support for ignorable file patterns extends only to the one-time process of adding unversioned files and directories to version control. Once an object is under Subversion's control, the ignore pattern mechanisms no longer apply to it. In other words, don't expect Subversion to avoid committing changes you've made to a versioned file simply because that file's name matches an ignore pattern—Subversion always notices all of its versioned objects.

bahrep
  • 29,961
  • 12
  • 103
  • 150
12

To ignore bin, obj and .suo files and user file from all projects. Just add them to the config file in:

C:\Users\[USERNAME]\AppData\Roaming\Subversion\config ( in windows )

Locate global-ignores part and add the following:

global-ignores = *.suo bin obj *.csproj.user
Calciol
  • 429
  • 4
  • 5
  • 2
    I don't want to make this a global setting because in some repos I *do* want to retain the `bin` directory in source-control. How can I ignore all bin and obj directories in a particular repo? – Dai Mar 10 '17 at 04:09
  • Does it take time for Tortoise to sync up these settings? Made the change, and I still keep getting bin and obj paths included. What a headache. – eaglei22 Apr 02 '18 at 18:14
  • No i does not take any time (on my Windows 10 box) – Calciol Aug 30 '18 at 07:20
5

You can ignore directories and files on a global level. But instead of hacking the config file, as described in the answer of Calciol, you can use the Settings dialog:

enter image description here

To start the Settings dialog:

  • start menu: TortoiseSVN ==> Settings.
  • right-click in explorer to bring up the context menu. TortoiseSVN ==> Settings.

Changes become effective immediately after applying.

3

Basic answer: Don't store compiled libraries and binaries in your Source repository. It's a source repository!

You can't ignore stuff under Subversion control and built items shouldn't be stored in Subversion in the first place. Delete them, then setup a svn:ignore to ignore these directories when they get built. That way, no one accidently recommits these built binaries.

If you want to store binaries and libraries for later use, use a release repository for that. In fact, you can even set it up, so that your builds will automatically download .dlls they might need from other projects. A release repository could be something as simple as a directory on another system where these files are stored (and can be copied to your other projects), or something more complex like Artifactory or Nexus (used for Maven and Ivy projects. I don't think there's something similar for VS and C/C++ projects).

Or, you can use Jenkins to do your builds, and store these items as built artifacts in Jenkins jobs. When someone needs them, they can download them through Jenkins.

David W.
  • 105,218
  • 39
  • 216
  • 337
  • 5
    But subversion added the bin folder. It's not like we told it to do that. The bin folder is under the root folder of the source structure so it just added every folder under the root. We know it's a source repository! Now we're telling it to not include non source files. I came here because I had the same issue. – Tony_Henrich Jul 29 '14 at 07:48
  • If you're using VisualStudio, use Subversion through Visual Studio. Get [AnkhSVN](https://ankhsvn.open.collab.net). AnkSVN won't automatically add `/bin` files because it knows what VisualStudio files shouldn't be in source control. You can see this info about [using TortoiseSVN through VisualStudio](http://tortoisesvn.net/visualstudio.html). You can also try [VisualSVN](http://www.visualsvn.com/visualsvn/), but this must be a paid for proprietary license. – David W. Jul 29 '14 at 14:41