.gitignore files deleted but files still ignored (git status doesn't show, can't add)

Well, I’m trying to track all the files I edited in my project, but git status doesn’t seem to be working: it doesn’t show some files that were changed. I’ve searched a lot about what could be happening but couldn’t go far.

I noticed I have some .gitignore files inside my theme folder /wp-content/themes/mytheme/.gitignore (and subfolders too) and I removed them. Have no idea of how they appeared there. I believe they are ignoring the files I modified.

What I need is to be able to track all modified files to commit, then push to bitbucket. (removing .gitignore files manually didn’t solve the problem).

  • Clean Git Repository using gitignore
  • How do I open source my Rails' apps without giving away the app's secret keys and credentials
  • Tell git never to update a file
  • Exclude specific files from 'git pull'
  • Git, ignore folder except for some files with certain extension
  • Selective git ignore by remote?
  • How to apply gitignore afterwards?
  • Unignore subdirectories of ignored directories in Git
  • One Solution collect form web for “.gitignore files deleted but files still ignored (git status doesn't show, can't add)”

    I’m assuming that by “git status doesn’t seem to be working”, you mean that modified files do not appear in the command’s output.

    If this is the case, your problem is probably caused by the fact that the files have been gitignored, and remained in the git’s cache as such.

    Running these two commands may solve your problem then:

    git rm -r --cached .
    git add .

    Your problem looks similar to this one, but the other way around. Have a look at the top voted solution and its comments.

    Make sure that you have a backup of your files before playing around, just in case.

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