GIT并非所有裁判都被推了

时间:2013-07-30 16:32:09

标签: git

我正在使用SmartGit并且我正在尝试将我的最新提交推送到裸存储库,这在/ media / webserver / git / projectname中肯定是裸的,但是我一直得到以下输出,有没有人知道怎么了?

由于

Push: Not all refs have been pushed.
'master' rejected (non-fast-forward)
Counting objects: 1   
Counting objects: 29, done.
Delta compression using up to 2 threads.
Total 15 (delta 11), reused 0 (delta 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'.        
error: failed to push some refs to '/media/webserver/git/projectname'

以下显示我之前尝试提交的输出&在我尝试拉动(rebase)最新更改之前推送,然后执行另一次推送导致上述输出。

Commit: Not all refs have been pushed.
[master e465187] * My commit message here
 6 files changed, 580 insertions(+), 325 deletions(-)
 rewrite controllers/courses/views/course_apply.php (98%)
 rewrite controllers/mail/cont_mail.php (96%)
'master' rejected (non-fast-forward)
error: failed to push some refs to '/media/webserver/git/projectname'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

1 个答案:

答案 0 :(得分:1)

在副本

中回答你不会立即看到的内容

看起来你想通过推出带有签出工作副本的回购来部署你的网站,这是一个坏主意,特别是因为它会产生这种错误。

您应该使用更新后挂钩和裸存储库as described here