git 推送不了,因为初始化为git init 而不是git --bare init

localhost:test hzq$ git push origin master
枚举对象: 16, 完成.
对象计数中: 100% (16/16), 完成.
使用 4 个线程进行压缩
压缩对象中: 100% (13/13), 完成.
写入对象中: 100% (16/16), 2.93 KiB | 749.00 KiB/s, 完成.
总共 16 (差异 1),复用 0 (差异 0)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: 默认禁止更新非纯仓库的当前分支,因为您推送的内容将导致索引和工作区
remote: 不一致,并且将需要执行 'git reset --hard' 将工作区匹配到 HEAD。
remote:
remote: 您可以在远程仓库中设置 'receive.denyCurrentBranch' 配置变量为
remote: 'ignore' 或 'warn' 以允许推送到当前分支。然而不推荐这么做,除非您
remote: 用某种方式将其工作区更新至您推送的状态。
remote:
remote: 若要屏蔽此信息且保持默认行为,设置 'receive.denyCurrentBranch'
remote: 配置变量为 'refuse'。
To 192.168.1.150:gitmts/.git
 ! [remote rejected] master -> master (branch is currently checked out)
error: 推送一些引用到 'git@192.168.1.150:gitmts/.git' 失败

 

在服务端执行 git config --bool core.bare true
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值