TL;DR; Are you even on the correct repository?
My story is bit funny but I thought it can happen with someone who might be having a similar scenario so sharing it here.
Actually on my machine, I had two separate git repositories repo1
and repo2
configured in the same root directory named source
. These two repositories are essentially the repositories of two products I work off and on in my company. Now the thing is that as a standard guideline, the directory structure of source code of all the products is exactly the same in my company.
So without realizing I modified an exactly same named file in repo2
which I was supposed to change in repo1
. So, I just kept running command git status
on repo1
and it kept giving the same message
On branch master
nothing to commit, working directory clean
for half an hour. Then colleague of mine observed it as independent pair of eyes and brought this thing to my notice that I was in wrong but very similar looking repository. The moment I switched to repo1
Git started noticing the changed files.
Not so common case. But you never know!