Hussain Akbar
Hussain Akbar

Reputation: 686

Adding files and directories to ignore list in Subversive for Eclipse

I have SVN running on a remote Apache server with repositories that I've created.

On my Windows 11 PC I have Eclipse 2023-03 with the Subversive 4.8 plugin.

On the server, I created a new blank repo. In Eclipse, I added a new PHP project with a single index.php file. I then shared the project using Team->Share.

Next, I copied over my project files from my temp directory into the workspace. My project has a number of files that I don't want committed to the repo. For example: upload/<any>.PDF. However, there is an upload/index.php which I do need.

Going to Team menu, the "Add to svn:ignore" is only shown for top level directories. For sub-directories and files, the option is greyed out.

svn:ignore greyed out

I then opened Project Properties->SVN Info. I tried to edit the svn:ignore list there but if I type \ or /, for e.g. upload/*.pdf, it says: You should use only ? or * to specify the pattern.

Specifying manually doesn't work

The existing entry says "application logs". I don't want to ignore the directory itself, but the *.log files within it.

BTW, adding *.pdf to global ignore list is not workable as there are PDF files in other directories that do need to be versioned.

Upvotes: 0

Views: 86

Answers (1)

Friedrich
Friedrich

Reputation: 4667

You need to add the directories (using either the svn add command or the Add to Version Control... context menu entry) you copied into your working copy before you can set the svn:ignore property on them.

I suspect the respective menu entry is greyed out in your subdirectories because they're not under version control and no properties can be set on them.

Quoting from the Red Bean Book, chapter Ignoring Unversioned Items (emphasis mine):

When found on a versioned directory, the svn:ignore property is expected to contain a list of newline-delimited file patterns that Subversion should use to determine ignorable objects in that same directory.

So two things follow:

  • You need to add your directories to version control first as said above.
  • Furthermore, svn:ignore property is supposed to be in the respective directory, i.e. setting it to something like path/to/a/file does not work. You're supposed to set svn:ignore to file in directory path/to/a. Also see Use path of subdirectory for svn:ignore property

Once you've verified that the set of files you added and ignored is correct and complete, you can svn commit all of them creating a new revision.

Upvotes: 2

Related Questions