Fixing Git’s “Modified Content Untracked Content” Error

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:

  1. I removed the .git directories from those new directories (this can create submodule drama. Google it if interested.)

  2. I then ran git rm -rf --cached /the/new/directories

  3. 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!

Related posts: