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
感觉里面还有一些坑,先把这个问题解决掉再说,以后的坑踩了再记录
推荐阅读
- gitlab|gitlab 通过备份还原 admin/runner 500 Internal Server Error
- gitlab|Gitlab升级(12.2.1到14.6.4)
- py连接mysql
- Flutter的ListView
- 常用git命令总结
- VM|VM ware 的 harbor 私有仓库搭建 (Ubuntu16.04)
- day16-Linux|day16-Linux 软件管理
- Xshell5|Xshell5 远程连接本地虚拟机Ubuntu16
- 圆形菜单
- Git学习-笔记摘要