svn:ignore and gitignore

1,111 views
Skip to first unread message

Wolfgang G

unread,
Nov 3, 2020, 7:09:47 AM11/3/20
to TortoiseSVN
Hallo,

I program with the TcXaeShell, which is integrated in Visual Studio 2017. In the project files is a file ".gitignore". As I work with subversion (or TortoiseSVN), I have inserted the contents of the file into the property "svn:ignore" and have used the property recursively. It seems to work, but I’m not sure if this is the right way.
Is there also a list of files to ignore for subversion?

Wolfgang

Bruce C

unread,
Nov 3, 2020, 7:38:19 AM11/3/20
to TortoiseSVN
Hi,

You have multiple options for ignoring files, as follows:
  • You can have the TortoiseSVN client globally ignore local files.
  • You can have the Subversion client globally ignore local files (that will also be ignored by TortoiseSVN).
  • You can set a property in your repository to have files ignored for that, specific repository folder (that will be recognised by all Subversion clients).
Since you are using the TortoiseSVN client, you can change the global ignores for TortoiseSVN and the Subversion client in the same place. Right click the Desktop and select the TortoiseSVN->Settings menu. The General page allows the TortoiseSVN specific global ignores to be set directly and also allows the Subversion ignores to be changed by editing the Subversion Configuration file. In the configuration file, update the global-ignores item. I use the Subversion configuration file because I want the settings to be used by TortoiseSVN and the command line client. I use these settings to ignore files created by the specific tools I use. For example, the editor I use has specific settings files that I want to ignore on my system but aren't relevant for other developers using other tools.

The next option is to set the file ignores for the repository, or a specific folder in the repository. For this, use the svn:ignore property. This is described in the Subversion documentation. I use this to ignore output artifacts created by the project that I don't want to include in version control. This might be compilation objects files or executables. This is the equivalent of the local .gitignore file you mentioned.

Hope this helps.

Pavel Lyalyakin

unread,
Nov 3, 2020, 7:47:27 AM11/3/20
to TortoiseSVN on behalf of Bruce C
Hello,

Don't forget about the svn:global-ignores inheritable property.
[[[
Subversion 1.8 provides a more powerful version of the svn:ignore property, the svn:global-ignores property. Like the svn:ignore property, svn:global-ignores can only be set on a directory and contains file patterns Subversion uses to determine ignorable objects.[21] These ignore patterns are also appended to any patterns defined in the global-ignores runtime configuration option together with any svn:ignore defined patterns. Unlike svn:ignore however, the svn:global-ignores property is inheritable [22] and applies to all paths under the directory on which the property is set, not just the immediate children of the directory.
]]]


--
You received this message because you are subscribed to the Google Groups "TortoiseSVN" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tortoisesvn...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tortoisesvn/35738884-57c3-4185-abcc-a77612f594c1n%40googlegroups.com.


--
With best regards,
Pavel Lyalyakin
VisualSVN Team

Wolfgang G

unread,
Nov 4, 2020, 5:03:56 AM11/4/20
to TortoiseSVN
Hello,

thanks for your hints and helpful links.
My original question, whether ".gitignore" works in "svn:ignore", I unfortunately have to answer no after a few attempts.
In .gitignore there are several entries in the form "[Bb]in/". In Subversion the slash at the end does not work.
Therefore I unfortunately have to edit all directories to be excluded.

Wolfgang
To unsubscribe from this group and stop receiving emails from it, send an email to torto...@googlegroups.com.

Bruce C

unread,
Nov 4, 2020, 5:26:16 AM11/4/20
to TortoiseSVN
Hi,

Sorry. I seem to have misinterpreted your query.

While I'm an occassional git user, my knowledge is such that I don't recall the details of the format for the .gitignore file. Consequently, I can't comment on whether the format is exactly the same as the Subversion format, without doing the documentation research. I can confirm that I use the Subversion property to ignore complete folders. In these cases, I don't have the trailing separator character - just the bare folder name.

Perhaps someone with better knowledge of git and Subversion may be in a position to comment on the differences. Alternatively, you could post the specific Subversion property items that aren't operating as you expect, noting your expected behaviour and the actual, observed behaviour. That would reduce it to simply being a Subversion query.

Hope this helps.
Reply all
Reply to author
Forward
0 new messages