I had an issue recently where I wasn’t able to add new directories to my a repo. I added normally, I used the -A option, all with no luck.
Each time, I’d get this issue:
The fix
Here are the steps I took to fix it:
- I removed the .git directories from those new directories (this can create submodule drama. Google it if interested.)
- I then ran
git rm -rf --cached /the/new/directories
- Then I re-added the directories with a
git add .
from above
What this does is make sure those directories aren’t their own repos, cleaned out what git knew about them beforehand, and then re-added them fresh.
Worked for me!