Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git won't stop tracking eclipse java .recommenders

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".

like image 911
Nenad Bulatović Avatar asked Dec 25 '14 21:12

Nenad Bulatović


People also ask

How do you move unstaged changes to staged changes in Eclipse?

Open one of your files, make a change, and you should see it appear in the Git Staging view in the Unstaged Changes window. Drag it into the Staged Changes area, add a commit message, and click Commit. You can also use the Team menu; right-click on the file, choose Team -> Add to Index, then Commit.

How do I open Git staging in eclipse?

Use Ctrl+3 (or Cmd+3) and type Git Repositories in the dialog to open the Git repositories view. This view shows you the Git repositories you can work with in Eclipse and allows you to add existing repositories to Eclipse, create or clone repositories. It also allows you to perform Git operations.

How do I push changes from GitHub to eclipse?

In Package Explorer, right-click your project and Select Team, Push Branch ... . Paste the clone URL from the clipboard into the URI field and select Next. Make sure Configure upstream for push and pull is selected in the next window and select Next. Review the changes and select Finish in the Push Branch window.

How do I switch to an existing branch in Eclipse?

Right-click your project and select Team → Branch to create new branches or to switch between existing branches. You can also switch branches in the History view.


1 Answers

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.

like image 134
Nenad Bulatović Avatar answered Oct 27 '22 11:10

Nenad Bulatović