How to fix "modified content, untracked content" in git?
What I did was to run:
git rm -rf --cached myuntrackedfolder
This tells git to forget about it (since it was being tracked formally).
Then I used:
git add myuntrackedfolder
to add it and I was good to go.
Remove .git from subfolders. This works for me.
Solution involves removing .git/ from the directories with the "modified content, untracked content" label, removing the --cached filed from those directories, and then running git add
on those directories once again.
Step-by-step solution:
- Remove .git/ from log4cplus and ../lib/notification/cppzmq.
- From parent directory from where you initialized your git repository, run the command:
git rm -rf --cached log4cplus/ && git rm -rf --cached ../lib/notifications/cppzmq
- Add and commit the directories to your branch again.
- Push to your branch.
Happy coding.
Tags:
Git
Git Submodules
https://newbedev.com/how-to-fix-modified-content-untracked-content-in-git