GIT错误:master -> master (branch is currently checked out)

来源:互联网 发布:数据新闻手册百度云 编辑:程序博客网 时间:2024/05/16 15:23

背景

git服务器搭建后,进行pull和push操作,结果发现无法push

1.错误信息

Could not chdir to home directory /var/services/homes/gaofei: No such file or directory对象计数中: 3, 完成.写入对象中: 100% (3/3), 202 bytes | 0 bytes/s, 完成.Total 3 (delta 0), reused 0 (delta 0)remote: error: refusing to update checked out branch: refs/heads/masterremote: error: By default, updating the current branch in a non-bare repositoryremote: is denied, because it will make the index and work tree inconsistentremote: with what you pushed, and will require 'git reset --hard' to matchremote: the work tree to HEAD.remote: remote: You can set 'receive.denyCurrentBranch' configuration variable toremote: 'ignore' or 'warn' in the remote repository to allow pushing intoremote: its current branch; however, this is not recommended unless youremote: arranged to update its work tree to match what you pushed in someremote: other way.remote: remote: To squelch this message and still keep the default behaviour, setremote: 'receive.denyCurrentBranch' configuration variable to 'refuse'.To ssh://gaofei@192.168.0.11//volume1/git_prj/ecc ! [remote rejected] master -> master (branch is currently checked out)error: 无法推送一些引用到 'ssh://gaofei@192.168.0.11//volume1/git_prj/ecc':错误

2.错误原因

其实出错信息中有提示“remote: ‘receive.denyCurrentBranch’ configuration variable to ‘refuse’.”,即使远程git拒绝了push操作

3.解决办法

修改git服务端的.git/config文件,增加push的设置,添加如下代码:

[receive] denyCurrentBranch = ignore
阅读全文
0 0
原创粉丝点击