git本地仓库推送到远程仓库报错

枚举对象: 5, 完成. 对象计数中: 100% (5/5), 完成. 写入对象中: 100% (3/3), 239 bytes | 239.00 KiB/s, 完成. 总共 3 (差异 0),复用 0 (差异 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 47.104.162.47:/home/git ! [remote rejected] master -> master (branch is currently checked out)

【git本地仓库推送到远程仓库报错】错误码太长了,stakoverflow一番,原因是在服务端创建的是一个非裸仓库,解决方式是在服务端重新创建一个裸仓库
git init --bare

感觉里面还有一些坑,先把这个问题解决掉再说,以后的坑踩了再记录

    推荐阅读