我已经通过首先克隆一个存储库然后'git commit'来启动git,但是当我执行'git push'时我收到这个错误:但它说'拒绝更新结帐分支'?
$ git push
Counting objects: 17, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (13/13), 2.72 KiB, done.
Total 13 (delta 5), reused 0 (delta 0)
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: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To ssh://michael@16.336.22.38/home/michae/scripts
! [remote rejected] master -> master (branch is currently checked out)
这是什么意思?
我搜索并阅读 如何应对 git push 上的“拒绝”?
我什至尝试'git push origin HEAD',它给了我同样的错误: