0

In git any user can modify .gitignore, list patterns to be ignored, and then actually commit the gitignore so that it is propagated to other users when they rebase.

I am just trying to find out whether the same functionality is available in svn. I am aware of svn:ignore but I am not sure if it does the same thing and in the same way (by modifying an actual file that can be checked in) or just writes it in some local settings that can't be shared with the team.

My suspicion is that the ignore list in svn is administered on the repo level by the admin and can't be distributed by a regular user like it can in git using gitignore, which is more "democratic" for the lack of a better term.

Community
  • 1
  • 1
amphibient
  • 29,770
  • 54
  • 146
  • 240

1 Answers1

0

svn:ignore is a property, which is not the same thing as a file.

This is the major difference between the two in the two systems, and they have subtle side-effects due to this fundamental disconnect.

Properties in SVN can be attached to many things, so a svn:ignore is typically done in one directory for that directory. This means you may have many svn:ignore directives

.gitignore is effectively the same as a svn property, but it is also a file.

Functionally they both do the same thing, they direct the client to stop complaining about files that aren't going to be committed. It is the manner in which they go about it, and the manner in which they behave which have subtle differences.

Edwin Buck
  • 69,361
  • 7
  • 100
  • 138
  • I don't have git on this laptop but i am pretty sure you can have `.gitignore` in any directory – amphibient Aug 22 '16 at 21:55
  • so you're saying that propagating ignores in svn across the team is not as easy as with gitignore ? – amphibient Aug 22 '16 at 21:56
  • it is effective recursively in the subdirectories but not upstream – amphibient Aug 22 '16 at 21:57
  • @amphibient Subverison has ways of adding properties recursively to a directory (or even a whole repository). But yes, if you don't specify the recursive options, you are likely to only ignore items in the directory the property is attached to. – Edwin Buck Aug 22 '16 at 21:58
  • my question was different. i was asking to confirm whether **distributing** ignores to other team members by just adding them to a file that is checked in is not as easy in svn as it is in git via gitignore ? i understand i can manipulate my own ignores but my question had to do with sharing it with the team – amphibient Aug 22 '16 at 22:00
  • @amphibient A quick check shows that .gitignore files in lower level directories do indeed suppress files in those lower level directories. – Edwin Buck Aug 22 '16 at 22:00
  • 1
    @amphibient SVN handles ignores differently. If you want them in a file, that's fine, but SVN won't ignore them because that's not how it handles them. They are in a property attached to the directory. So you basically add something (a property) to the directory which has a list of ignored items. When they checkout the directory, they also get the ignored items, without displaying a file. It is also how SVN handles executable bits, mime types, and other permissions. If svn did it with files, you'd have a .svnpermissions, .svnexecutable, .svnignore, etc. – Edwin Buck Aug 22 '16 at 22:03
  • yes but the answer i am not getting is whether it can be **shared with the team** or not like it can in git using gitignore. – amphibient Aug 22 '16 at 22:11
  • 1
    @amphibient Yes, if you can share the directory with the team, all the attributes get shared. Also the attributes are revision controlled with the directory, so updates get coordinated with revision across the whole team too. – Edwin Buck Aug 22 '16 at 22:42
  • Properties are shared. So if you add a svn:ignore property to a folder to tell (for instance) that *.log should be ignored, and if you commit that folder/property then all your team will ignore the *.log in that folder (if they have an up to date folder). – YMomb Aug 23 '16 at 08:31