1

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

Nick Volynkin
  • 14,023
  • 6
  • 43
  • 67
jeanm
  • 1,083
  • 1
  • 9
  • 22
  • 3
    *“`git status` doesn't seem to be working”* – How so? What’s happening? What’s not working? You only mention that you have lots of gitignore files but never say how that’s a problem at all. – poke Jun 06 '15 at 16:37
  • Shouldn't git status track all my modified files? I believe .gitignore files are blocking this. I need to cancel this .gitignore function (which i have no idea of how appeared in my project). – jeanm Jun 06 '15 at 16:47
  • .gitignore files should contain a list of files and filetypes that should be ignored. If none of them match your files, then that should not be the issue. What OS are you on? can you provide a listing of the directory? – pcnate Jun 06 '15 at 16:47

1 Answers1

3

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.

Community
  • 1
  • 1
Mehdi
  • 7,204
  • 1
  • 32
  • 44