2013-07-30 136 views
2

我正在使用SmartGit,我试图将我的最新提交推送到裸仓库,这绝对裸露在/ media/webserver/git/projectname,但我不断收到以下输出,有没有人知道什么是错的?GIT并非所有的参考文献都已被推送

感谢

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' 

而下图为我先前试图提交&推前我试着拉(重订)的最新变化,然后做一套推这就造成了上面的输出的输出。

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. 
+2

的可能重复[混帐推错误“\ [远程拒绝\]大师 - >主(支,目前已签出)”] (http://stackoverflow.com/questions/2816369/git-push-error-remote-rejected-master-master-branch-is-currently-checked) – Shahbaz

回答

1

回答,你不会马上看到重复的

它看起来像你想推一个签出的工作副本,这是一个坏主意,回购部署你的网站是什么,尤其是因为它会带来这种错误。

而应该做使用更新后钩和一个纯仓库,as described here

+1

谢谢,看起来像我编辑裸仓库的URL到SSH,而不是存储库本地安装的路径。这可能会导致一些用户权限问题。 – melon