我正在准备一个Git演示在我的Windows笔记本电脑上,这是离线的。
使用gitbash,我在/c/demo/Git-demo/中创建了一个小项目,并进行了Git初始化,添加了test.txt文件并提交了它。
cd /c/demo
git clone /c/demo/git-demo git-demo-clone
cd git-demo-clone
ls -l
很好,我看到test.txt了。
然后我修改git demo克隆中的文件并进行提交,这同样可以正常工作。
但是,当我下一次从git demo clone执行git push时,我得到了一个错误
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
怎么办?