This occurs because you might have git directories in other folders as well.
Just do the following steps:
1.Get rid of the .git directories from other folder
2.Next, run git rm -rf --cached on the other folders
3.After that, re-add the directories with a git add -A from above
4.Then perform a commit, git commit -m "commit message"
5.Finally, push your commit remotely, git push origin your-branch-name