Bare repo:并非所有裁判都被推了

时间:2013-09-25 08:25:26

标签: git git-push git-pull git-remote

当尝试将提交推送到裸的远程存储库时,我收到以下错误:

Push: Not all refs have been pushed. 'master' rejected (non-fast-forward) 
refusing to update checked out branch: refs/heads/master. By default, updating 
the current branch in a non-bare repository is denied, because it will make 
the index and work tree inconsistent with what you pushed, and will require 
'git reset --hard' to match the work tree to HEAD.

You can set 'receive.denyCurrentBranch' configuration variable to 'ignore' or 
'warn' in the remote repository to allow pushing into its current branch; 
however, this is not recommended unless you arranged to update its work tree 
to match what you pushed in some other way.        

To squelch this message and still keep the default behaviour, set
'receive.denyCurrentBranch' configuration variable to 'refuse'.

error: failed to push some refs to 'server'

我已经研究过这个错误,它似乎表明我正在推动的存储库不是裸露的,事实并非如此。这可能是git的一个问题吗?我正在使用SmartGit客户端。

我也试过从远程仓库拉动,这没有任何影响。

1 个答案:

答案 0 :(得分:1)

好吧,这很奇怪,我之前肯定检查过git配置文件,并且它设置为true。我完全相信它!

此外,包括我自己在内的人也能够推荐这个回购。你发出的命令返回false,所以我重新检查了git配置文件,并将bare设置为false。我将其设置为true并推送,问题解决了!

git config --bool core.bare
#returned false

配置文件必须在我不知情的情况下在某些时候进行编辑。