I have a Git submodule that I have successfully cloned in to my main project. However, when I make changes in the submodule and try to push them back to the original submodule repository, Git refuses to do it. Why, and how can I fix this?
Example: I have project sub and project super in two separate folders. I included sub as a submodule under super. I make changes in folder super/sub, then try to push these changes to the original project sub. Git complains.
EDIT: Regarding the error message, I'm using Git Bash on Windows and unfortunately cannot get the exact error message copied out of the terminal. Here's the most pertinent lines:
remote: error: refusing to update checked out branch: refs/heads/master. By default, updating the current branch in a non-bare repository is denied, because it will make the index and work tree inconsistent with what you pushed, and will require 'git reset --hard' to match the work tree to HEAD.
Note: Both repositories live on my hard drive.