git fatal: when trying git rm –cached

Hi When trying to switch between branch, I have a error:

error: The following untracked working tree files would be overwritten by checkout:
        Project/.project
Please move or remove them before you can switch branches.

but when I try to use

  • Eclipse and external src and web content folder linking or mapping
  • GIT support in Eclipse
  • Jenkins monitoring plugin for Eclipse
  • How to make Eclipse recognise a Git source tree that was a Bazaar source tree
  • SVN blame in Eclipse
  • Files disappear when commit branches in Eclipse
  • git rm --cached  Project/.project
    

    I get a error:

    fatal: pathspec 'Project/.project' did not match any files
    

    Please suggest a work a round, Any way some of the files might be moved is some of the branches and the added a gain, and please explaine the two errors.
    Thanks

  • How to handle tracked generated files in git?
  • How do I do a pristine checkout with mercurial?
  • How to pull a branch deletion in git?
  • How to resolve merge conflicts in Git?
  • Is it possible to have separate git ignore rules for each remote?
  • git: merge conflicts over newline at end of file
  • One Solution collect form web for “git fatal: when trying git rm –cached”

    For a workaround, either remove Projects/.project or save it somewhere outside your repository if you need to keep it.

    What is happening is your current work tree on your current branch has this file, but you are not tracking it (and maybe it’s .gitignored on top of that). However in the branch you want to checkout, someone has at some point in the past git added and committed that file. Since your current copy is not tracked by git, git refuses to overwrite it with the tracked copy, and also refuses to git rm --cached it, because it doesn’t know anything about it. This is in general a good thing. However, you might need to evaluate whether this file needs to be tracked, and if not, perhaps it needs to be purged from that other branch…

    Git Baby is a git and github fan, let's start git clone.