git push 出错error: failed to push some refs to ....
git.exe push --progress "origin" master:master
Enumerating objects: 113, done.
Counting objects: 100% (113/113), done.
Delta compression using up to 12 threads
Compressing objects: 100% (57/57), done.
Writing objects: 100% (62/62), 17.99 MiB | 3.83 MiB/s, done.
Total 62 (delta 45), reused 0 (delta 0), pack-reused 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: 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.
remote:
remote: You can set the 'receive.denyCurrentBranch' configuration variable
remote: to 'ignore' or 'warn' in the remote repository to allow pushing into
remote: its current branch; however, this is not recommended unless you
remote: arranged to update its work tree to match what you pushed in some
remote: other way.
remote:
remote: To squelch this message and still keep the default behaviour, set
remote: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To F:\00mfc
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'F:\00_mfc'
git did not exit cleanly (exit code 1) (15516 ms @)
在服务端config文件中添加如下
打开后添加如下处理
[receive]
denyCurrentBranch = ignore
如下图