下午在做git的一些相关操作的时候,遇到了个问题,现在记录下来:
情景:我在E盘建立了一个仓库和一个工作空间,先把仓库里面的项目clone到工作目录,然后修改工作目录里面的东西,修改了之后打算push回去仓库里面,结果,问题大了,push出现错误了:
错误信息如下:
remote: error: its current branch; however, this is not recommended unless you[K
remote: error: arranged to update its work tree to match what you pushed in some[K
remote: error: other way.[K
remote: error: [K
remote: error: To squelch this message and still keep the default behaviour, set[K
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.[K
To E:/git
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'E:/git'
我搜索了网上相关解决方案,找到了解决方法,根据步骤。我在工作空间里面执行了以下命令:
git config receive.denyCurrentBranch ignore(这个命令用于初次配置git的接收)
接着我再度尝试,结果,出现了下面另一个错误:
remote: error: other way.[K
remote: error: [K
remote: error: To squelch this message and still keep the default behaviour, set[K
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.[K
To E:/git
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'E:/git'
Done
经过再度思考,考虑到刚刚只是配置工作空间的git接受,但是真正的仓库还没有配置,那么就没法进行对接了,所以,我在仓库执行了相同命令,问题解决了~~
==================================================================
欢迎交流:QQ392989505
作者:王瓒