Subclipse svn:ignore
Asked Answered
S

12

177

I'm using subclipse for connecting to my SVN. There are some folders and files I would like to add to svn:ignore, but it's grayed out. Is there an easy way to get subclipse to ignore files and directories?

subclipse

Suffrage answered 1/7, 2009 at 0:42 Comment(0)
S
282

You can't svn:ignore a file that is already commited to repository.

So you must:

  1. Delete the file from the repository.
  2. Update your project (the working copy) to the head revision.
  3. Recreate the file in Eclipse.
  4. Set svn:ignore on the file via Team->Add to svn:ignore.
  5. Restart eclipse to reflect changes.

Good luck!

Shortcake answered 1/7, 2009 at 14:25 Comment(16)
Works as stated. Been fighting with this for hours... Henrik is the MAN :)Altercate
Well in fact. This is not a solution. I have the same problem and my files and folders I want to ignore are not under version control. Still I cannot ignore them because the svn:ignore is grayed out.Laquitalar
@Shortcake its a long time but can u tell me what i should do if i dont want a file, such as my database.properties file, which is already on the repository to not be pushed to the repository on commit.Mailbox
@Jagger: the parent folder has to be already in svn to be able to set the svn:ignore propertyGinzburg
@mmoossen: The problem is the parent folder is already in svn. The situation I have is: a folder that is a package (already checked into svn) and the subpackage (which is a subfolder) with generated JAXB code (which I do not want to check in). The button is grayed out even if the parent folder is in svn.Laquitalar
@Laquitalar Delete from SVN and from project. Rebuild. Newly created folders bin and res can now be selected to svn:ignore (no more grayed out!)Rarebit
What do you mean by "Recreate it in Eclipse"??Mincey
@akapelko: I mean that you must copy or move the file to the location in the Eclipse project you want it to be located in.Shortcake
If anyone struggled to actually delete the files before adding to ignore, check out my question here #15045640Triarchy
After doing what is mentioned in the solution, select the folder and use the shortcut (Ctrl + Alt + I) to add it to ignore. I don't know why this works and the menu doesn't, it might be a bug.Eighteenth
If you're using subclipse you can do this within eclipseby (1) window -> show view -> other -> svn -> svn repositories (2) deleting the problem directory (3) updating your local copy (4) adding the directory to svn:ignoreObeng
I just had to go through these steps: 1) Share project to svn 2) Delete project from eclipse (and on disk) 3) Delete the directories that should be in svn:ignore from svn 4) Check out the project from svn into eclipse again 5) Add folders to svn:ignore 6) commit the project root (which commits the svn:ignore changes). At this point your project should display with no changes and be good to go.Sadowski
If the folder is auto-generated by Eclipse (like target/ or bin/), disable "Build Automatically" first!Callus
One more thing... If you already ignored those files through Eclipse (with Team -> Ignored resources) you have to undo these settings so the files are controlled by Subclipse again and "Add to svn:ignore" option reappearsCheddite
To remove bin from version control I had to (1) delete the folder in eclipse (2) commit the change to my repository (3) select svn:ignore from team. Until I committed the delete there was no way to remove it from version control.Obeng
in my eclipse, I have to do Team -> Ignored Resources -> Add PatternMortimer
S
20

I was able to do this using TortoiseSVN directly from Windows explorer:

Right click on file to ignore->TortiseSVN->Delete and add to ignore list

I had to close then re-open the project in Eclipse, job done :)

Secretarygeneral answered 26/1, 2010 at 9:48 Comment(2)
TortoiseSVN is not Subclipse.Surprising
Correct. It isn't.Secretarygeneral
O
17

It seems Subclipse only allows you to add a top-level folder to ignore list and not any sub folders under it. Not sure why it works this way. However, I found out by trial and error that if you directly add a sub-folder to version control, then it will allow you to add another folder at the same level to the ignore list.

alt text

For example, refer fig above, when I wanted to ignore the webapp folder without adding src, subclipse was not allowing me to do so. But when I added the java folder to version control, the "add to svn:ignore..." was enabled for webapp.

Oke answered 25/12, 2010 at 3:44 Comment(3)
Odd but this worked for me as well; if you make a mistake and 'Add' the top folder of a new SVN repo you can right click 'Team > Disconnect..." and choose delete SVN meta information.Courser
I just tested this and can confirm this works. This seems crazy and possibly due to a bug or design error, but it works...Gonick
Best solution, by far. Accepted solution has no sense!Priddy
P
12

If you are trying to share a project in SVN with Eclipse for the first time, you might want to avoid certain files to be commited. In order to do so, go to Preferences->Team->Ignored Resources. In this screen you just need to add a pattern to ignore the kind of files you don't want to commit.

Eclipse preferences

Prominent answered 19/6, 2015 at 8:30 Comment(0)
L
6

Working with Subclipse on Eclipse Indigo Service Release 2

I had commited folders with temporary files and logs lying under /src to the SVN repository. And after realizing it, I found myself in the same situation with a grayed out "svn:ignore"

I found following solution:

1. I deleted the folder from my Project Source

2. Team -> Commit... withouth the folder

3. Recreated the folder back into the project tree

Now I was able to use "Team -> Add to svn:ignore..."

Lawley answered 13/7, 2012 at 15:59 Comment(0)
G
3

This is just a WAG as I am not a Subclipse user, but have you ensured that the folders containing what you're trying to ignore have themselves been added to SVN? You can't svn:ignore something inside a folder that's not under version control.

Gentilism answered 1/7, 2009 at 0:53 Comment(1)
yup, the containing folder is in the SVNSuffrage
T
3

What worked for me was following : (eclipse 3.3.6 Subclipse 2.4)

  • set svn:ignore property via tortoise : ( .settings .classpath .project target .apt_src one item at one line)
  • deleted the project from the eclipse
  • fresh checkout from the svn
  • import the project in eclipse (simple reimporting the project in eclipse did not worked for me)
Teishateixeira answered 14/7, 2012 at 18:1 Comment(0)
C
2

I just figured out how to do this:

It appears that when you add a parent folder to version control, Eclipse adds all sub-folders. Once the sub-folders are added to version control, it is not possible to ignore them.

Here's how to do it:

Right click on the top level folder and add to version control Right click on the child folder you want to ignore, revert Right click on the child folder you want to ignore, svn:ignore (which will now be available)

Coth answered 17/12, 2017 at 21:39 Comment(1)
That was it, that finally helped. Thanks.Mach
A
1

to ignore certain files or turn off ignoring you can use the eclipse preferences-->Team -->Ignored Resource. Check or uncheck the resources you want to be tracked.

Alectryomancy answered 8/8, 2013 at 23:49 Comment(0)
T
0

This is quite frustrating, but it's a containment issue (the .svn folders keep track also of ignored files). Any item that needs to be ignored is to be added to the ignore list of the immediate parent folder.

So, I had a new sub-folder with a new file in it and wanted to ignore that file but I couldn't do it because the option was grayed out. I solved it by committing the new folder first, which I wanted to (it was a cache folder), and then adding that file to the ignore list (of the newly added folder ;-), having the chance to add a pattern instead of a single file.

Tumer answered 29/3, 2011 at 13:29 Comment(0)
C
0

One more thing... If you already ignored those files through Eclipse (with Team -> Ignored resources) you have to undo these settings so the files are controlled by Subclipse again and "Add to svn:ignore" option reappears

Cheddite answered 25/9, 2013 at 8:39 Comment(0)
I
0

In case you're using TortoiseSVN and the file is already commited, go to your files project folder, right click on the file/folder you want to ignore, TortoiseSVN -> Unversion and add to ignore list. Then you delete the folder/file (click on it and then push DELETE on your keyboard), right click on your project folder, -> SVN Commit... This will delete the folder from the repository.... Now you can create your folder/file again and then it will be ignored.

Incandesce answered 3/5, 2017 at 18:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.