29

I have some files which I can't add to svn:ignore using subclipse and I don't know why.

enter image description here

The usual reasons for not being able to add files to svn:ignore seem to be that the file is already in the repository or that the folder the file is in hasn't been created yet. Neither of these seem to apply here so I don't know what the cause is.

Edd
  • 8,402
  • 14
  • 47
  • 73

5 Answers5

25

The file has clearly been added to version control. If this were the command line, then someone would have executed svn add but not yet committed the change. So the file is currently in the "scheduled-add" state. If you want to ignore the file, then first do Team > Revert to remove the scheduled add state. You will then be able to add it to svn:ignore for the parent.

UPDATE: When reverting files do not select files that are currently "unversioned". Reverting a file that is not versioned means Subclipse will delete the file. IF you ever accidentally delete something, note that Eclipse has a 'Restore from Local History' option. The items you removed will typically still be available in Local History.

user152468
  • 3,202
  • 6
  • 27
  • 57
Mark Phippard
  • 10,329
  • 2
  • 32
  • 42
  • 3
    I performed a Revert on the files and the '+' on each of the icons changed to a '?' and I was then able to add to svn:ignore – Edd Sep 17 '12 at 17:18
  • 3
    I performed a revert and now my project is gone. WHAT! – Duncan Calvert May 26 '13 at 00:22
  • 8
    Please, PLEASE, add a disclaimer to this post. I just deleted my entire project. Luckily I had backed it up to my laptop the other day. If I had not done this, I would have been out literally thousands of dollars. – Duncan Calvert May 26 '13 at 00:37
  • This was getting me until I realized I had submitted something down the directory tree. – Andrew Sep 04 '14 at 19:01
  • In my case, the folder name (I wanted to add to svn:ignore) was already in the project properties -> SNV Info. But somehow Eclipse did not get it. While removing it from svn:ignore manually did not change anything, reverting the Project (after committing all relevant changes) did the trick. – BurninLeo Dec 11 '16 at 13:01
  • The update still isn't very clear to me. If you revert the file you want to add to svn:ignore, then you do not select that file, revert doesn't do anything. Are you using a specific definition of "unversioned"? I think you are discluding files that are "scheduled add", right? In my case, I found it was fine to include those folders in the revert, but I just did the top level, in case. – Dan Gravell Jan 26 '17 at 16:12
8

The answer above is very bad advice, Revert could delete everything if your files are not in SVN. The real answer is here: Subclipse svn:ignore, most likely cause for this issue is the parent folder is not added to svn.

Community
  • 1
  • 1
  • 6
    The answer is accurate for the question. The example screenshot shows the files with a + which means they are schedule-add. Revert should bring them back to unversioned status. If you revert an unversioned file, marked with a ?, then yes it is removed. FWIW, anything that is reverted is also available in the Eclipse Local History. – Mark Phippard Jun 12 '13 at 16:36
  • 2
    I do not understand why someone would find this particular question and then do the wrong thing? The question is about why they cannot ignore an already versioned file. Should I add a disclaimer about selecting all your files and then hitting the Delete key while I am at it? – Mark Phippard Jul 11 '13 at 21:53
  • I am disappointed in your reply. It is sarcastic and disrespectful to my true intent. You are a great developer and your reputation on this site reflects this. I made my peace offering and don't wish to take away from this question. Let's leave it here. – GeekyOmega Jul 12 '13 at 13:27
1

To SVN ignore a file you already checked in:

1) Move the file from your workspace to a temporary directory
2) Team -> Synchronize with repository
3) Commit the file deletion
4) Copy the file back to your workspace
5) Refresh
6) Team -> Synchronize with repository
7) Add to .svnignore
8) Team -> Update (required for whatever reason)
9) Team -> Synchronize with repository
10) Commit changes to the parent folder

Abdul Ahad
  • 826
  • 8
  • 16
0

When I ran into this problem it was because I had already ignored it. Right click project and select Team and Show Properties. Keep in mind that svn:ignore is stored on the server so it will be there even after you pull down a project from the repo.

geekinit
  • 1,345
  • 2
  • 14
  • 17
  • This does not work. Even when added to svn:ignore manually, a folder that already is under version control will still be synchronized/commited. – BurninLeo Jan 31 '16 at 10:15
  • @BurninLeo, my scenario was that I had already ignored the file previously and forgot. That's why "Add to Version Control" was greyed out for me. – geekinit Jan 31 '16 at 21:47
  • Hahaha :) Sorry ... was the late hour. I fully misunderstood: "When I ran into this problem it was because I had already ignored it" - I understood you had ignored the problem earlier and than it came back to you like a boomerang. Btw: Thanks for the direction "Team" -> "Show Properties" - I did not know this before! – BurninLeo Feb 01 '16 at 08:49
  • At times, svn can be a strange beast within eclipse. My luck has been with the subversive plugin. I do like the "Synchronize with Repo" stuff. If you still need to establish svn:ignore for files already committed, you might try removing the files from eclipse (perhaps cut and paste the file somewhere outside the project or copy and option move on a mac), refresh your project and then commit the changes, add the file back to your project, right-click the file > Team > Add to svn:ignore. When I tried it I had to do a Team > cleanup and an Team > update before the finally committing. – geekinit Feb 02 '16 at 04:20
0

I tried a lot of ways to remove a folder from SVN version control. This is the only way that worked for me (Eclipse Mars):

  • Close Eclipse
  • Open .svn/wc.db (in the local project copy) with an appropriate SQLite database editor
  • In table nodes remove the entry of the folder and it's subfolders
  • Commit the changes (if necessary)
  • Start Eclipse

That's it.

Note: To add a file or folder to svn:ignore, it's parental folder must be under version control. The above steps are only intended to remove a file from version control, that already is under version control.

BurninLeo
  • 4,240
  • 4
  • 39
  • 56