2013-07-30 92 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