views:

1685

answers:

6

So I have some files I want to ignore in a subversion repository, but I don't want my ignore patterns for this to be propagated to the repository.

In other words, I added some private files in my checkout that I want to keep, but they only exist for me and wouldn't make sense to be ignored for everyone, so if I use the svn:ignore, this will apply on the directory, and I either have to check that in (which I don't want to do), or see that this directory was modified every time I do an svn status.

So, ideally I would like something like a .svnignore file which I could then mark to ignore itself as well as some other files (I think this is a possibility in git for example, using a .gitignore file, or whatever the name is).

I'm guessing it might work to ignore the whole directory (maybe), but then I suspect I won't see any new files in that directory, which would also not be desirable.

So does anybody know a way to do this in subversion?

A: 

I'm confused about 2 things:

  • why do you have files that you don't want to check in that other people might want to check in? seems like you'd get a conflict if that happened anyway
  • does just "ignoring" in the human sense not work for you?

I'm just having trouble seeing a scenario where you wouldn't want to use svn:ignore...

Ben Scheirman
I'm trying to do the same thing. Yes, you can ignore those files, but it would be much better if svn were to ignore those files. It's kind of like how you'd want a search engine to put results you care about at the top, not on the third or fourth page.
allyourcode
A: 

Couldn't you in theory just not check in your .svnignore file?

matt b
A: 

Well, in my specific case, there is a lib directory where we store 3rd party libs. I have some symlinks to some other libs that don't really belong there, but I added them there for a convenience for some things that make sense for me (but not everyone else using the repository). Thus, I don't want them cluttering up my svn status.

Mike Stone
A: 

@matt b

There is no .svnignore file, that's what I want though... the way to ignore in subversion is to set svn:ignore properties on the directory... but that marks the directory as modified, which I don't want to see in my svn status because I don't want to check these ignores in.

If there is a .svnignore file that I am not aware of, that would of course solve the problem..............

Mike Stone
No, there is not a .svnignore that you are not aware of.An easy workaround is to write a simple script that adds and removes these links as needed.A better solution, I think, is not to put libraries in a directory where they don't really belong.
sock
well, they belong there for ME, they just don't REALLY belong in source control... I may actually be able to remove them, but there are still other files I would love to ignore but can't because my only option is svn:ignore
Mike Stone
+4  A: 

Subversion does have a per-user, global ignore setting, which sounds like what you want. Look in your .subversion directory (found in your home directory) and locate the Miscellany section of the config file. There should be an entry called global-ignores.

For Windows users, this setting is found in the registry under HKEY_LOCAL_MACHINE\Software\Tigris.org\Subversion.

More information is available in this document.

I don't think that's what this question is asking. Sounds like Mike wants svn to ignore certain files and directories in one particular working copy, not every working copy on his whole system. btw, I have a similar unanswered question: http://stackoverflow.com/questions/1146347/how-do-i-make-svn-ignore-unversion-files-only-in-my-working-copy
allyourcode
+1  A: 

@Todd Myhre

I thought of the global ignore too, and after not finding a dotfile solution, I decided to attempt that... though I think it is a bit hacky to define specific files of 1 repository in a global setting (I'd rather have an ignore setting per repository).

Unfortunately, it doesn't seem to work. I could match my file as "foo.file", but I can't specify the file specifically "/full/path/to/foo.file"... I can't even specify a relative path such as "to/foo.file". I think the global-ignores only deals with the NAME of the file, instead of the full path.

This is insufficient, I want to be able to ignore specific files in specific checkouts and not have them affect other checkouts... or even other files of the same name in the same checkout.

Mike Stone