Search code examples
gitgitignore

Git not ignoring files having .classpath and folders


My project has lots of nested directories and certain files ending with . e.g .classpath,.properties . I need to ignore them so I am using pattern /.classpath however git is not ignoring them and if I am try to ignore a folder using pattern EJBServer/** its not ignoring the folder.I have tried response people have shared for the same issues reported in stackoverflow however its not working

I have attached the git status output.Any help would be appreciated.enter image description here


Solution

  • Do you want to ignore 'EJBServer/**' files?

    EJBServer/** files status is modified.

    That is you already staged this file. Maybe you already commit this files.

    git rm -r --cached EJBServer/** 
    git add EJBServer/**
    git commit -m "fixed untracked files"
    

    try this.