I am trying to prepare a Git demo on my Windows laptop, which is off line. Using Git Bash, I created a small project in /c/demo/git-demo/ and did a git init, and added file test.txt and committed it.
Then in another shell, I did
cd /c/demo
git clone /c/demo/git-demo git-demo-clone
cd git-demo-clone
ls -l
That works fine, I see test.txt.
Then I modify the file from git-demo-clone and do a commit, which again works fine.
However when I next do git push from git-demo-clone, I get an error
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: is denied, because it will make the index and work tree inconsistent
remote: with what you pushed, and will require 'git reset --hard' to match
remote: the work tree to HEAD
What to do?