I am attempting to use plumbing commands for the first time and decided to write a script script that will warn me when I've been an idiot and forgotten to commit or push changes. I'm doing something similar to what is done in this answer.
However, when I make a fresh clone of a repository (git clone ...
), then run git diff-files
in that repository, it shows multiple modified files. If I run git status
, then re-run git diff-files
, the modified files are no longer listed.
Since it may matter, I am running on CentOS.
Two questions:
- What is causing
git diff-files
to think there are modified files in a fresh clone? - Why does running
git status
"fix" this?