5

I haven't had this problem before Eclipse Luna (I updated from Kepler just few days ago). Although I added to .recommenders to .gitignore it keeps tracking it.

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   .recommenders/caches/identified-project-coordinates.json
        deleted:    .recommenders/index/http___download_eclipse_org_recommenders_models_luna_/_3.fdt
        deleted:    .recommenders/index/http___download_eclipse_org_recommenders_models_luna_/_3.fdx
        deleted:    .recommenders/index/http___download_eclipse_org_recommenders_models_luna_/_3.fnm
        deleted:    .recommenders/index/http___download_eclipse_org_recommenders_models_luna_/_3.frq
        deleted:    .recommenders/index/http___download_eclipse_org_recommenders_models_luna_/_3.nrm
        deleted:    .recommenders/index/http___download_eclipse_org_recommenders_models_luna_/_3.prx
        deleted:    .recommenders/index/http___download_eclipse_org_recommenders_models_luna_/_3.tii
        deleted:    .recommenders/index/http___download_eclipse_org_recommenders_models_luna_/_3.tis
        modified:   .recommenders/index/http___download_eclipse_org_recommenders_models_luna_/segments.gen
        deleted:    .recommenders/index/http___download_eclipse_org_recommenders_models_luna_/segments_4
        modified:   .recommenders/repository/http___download_eclipse_org_recommenders_models_luna_/org/ecli
.properties

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        .recommenders/index/http___download_eclipse_org_recommenders_models_luna_/_5.fdt
        .recommenders/index/http___download_eclipse_org_recommenders_models_luna_/_5.fdx
        .recommenders/index/http___download_eclipse_org_recommenders_models_luna_/_5.fnm
        .recommenders/index/http___download_eclipse_org_recommenders_models_luna_/_5.frq
        .recommenders/index/http___download_eclipse_org_recommenders_models_luna_/_5.nrm
        .recommenders/index/http___download_eclipse_org_recommenders_models_luna_/_5.prx
        .recommenders/index/http___download_eclipse_org_recommenders_models_luna_/_5.tii
        .recommenders/index/http___download_eclipse_org_recommenders_models_luna_/_5.tis
        .recommenders/index/http___download_eclipse_org_recommenders_models_luna_/segments_6

no changes added to commit (use "git add" and/or "git commit -a")

Here is my .gitignore file:

*target*
*.jar
*.war
*.ear
*.class

# eclipse specific git ignore
*.pydevproject
.project
.metadata
bin/**
tmp/**
tmp/**/*
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
.recommenders/

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

If I do git rm -rf --cached it removes it, but soon starts tracking again - as soon as my colleague makes changes in his files and push it on Bitbucket and I do pull. How should I fix this problem permanently?

Also, when I just did "git rm -r --cached .recommenders" it deleted whole bunch of cached files but top level directory stays.

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        .recommenders/

nothing added to commit but untracked files present (use "git add" to track)

If I try to remove it then it completely resets Eclipse workspace, and I have to import all projects all over again (so it doesn't physically delete workspace".

Nenad Bulatović
  • 7,238
  • 14
  • 83
  • 113
  • 2
    Doing `git rm --cached` is the right thing to do, but all of your colleagues should do it as well... Otherwise you'll keep having this problem – fge Dec 25 '14 at 21:50
  • @fge Yes, but what puzzles me is that all of us did it, and problem still pop out after a while? – Nenad Bulatović Dec 25 '14 at 21:51
  • @fge Also, when I just did "git rm -r --cached .recommenders" it deleted whole bunch of cached files but top level directory stays. "$ git status On branch master Your branch is up-to-date with 'origin/master'. Untracked files: (use "git add ..." to include in what will be committed) .recommenders/ nothing added to commit but untracked files present (use "git add" to track)" If I try to remove it then it completely resets Eclipse workspace, and I have to import all projects all over again (so it doesn't physically delete workspace". – Nenad Bulatović Dec 25 '14 at 22:00
  • I don't get it, `--cached` is supposed to leave the files in there; did you commit after that? – fge Dec 25 '14 at 22:04
  • @fge Yes, perhaps I should check tomorrow settings on other workstations, maybe something is missing – Nenad Bulatović Dec 25 '14 at 22:07
  • @fge As it turned out, on one workstation there was missing ".recommenders/" in ".gitignore" file. You pointed me in right direction, so if you want, expand your comment with checking for this besides doing "git rm -rf --cached" on all workstations and I will accept your answer. – Nenad Bulatović Dec 26 '14 at 22:55
  • 1
    I didn't really mention the .gitignore, did I? ;) That's OK, the essential thing is that you eventually solved your problem! Have fun ;) – fge Dec 26 '14 at 22:58

1 Answers1

6

As it turned out, on one workstation there was missing

.recommenders/

in .gitignore file on one workstation. Adding that as well as running

git rm -rf --cached

on every workstation solved the problem.

Nenad Bulatović
  • 7,238
  • 14
  • 83
  • 113
  • 1
    That will remove all cached files. I believe would be less harmful to do this: `git rm -r --cached .recommenders/**/*` – marcelocra Apr 26 '15 at 00:05