2012-03-06 34 views
8

我用git設置了一個EC2實例,並使用post-receive鉤子,我用this tutorial將它部署到了我的服務器。這是我的控制檯的輸出:帶git post-receive鉤子的邊帶解複用器的錯誤

$ git push production master 
[email protected]'s password: 
Counting objects: 26, done. 
Delta compression using up to 4 threads. 
Compressing objects: 100% (19/19), done. 
Writing objects: 100% (19/19), 2.51 KiB, done. 
Total 19 (delta 14), reused 0 (delta 0) 
fatal: The remote end hung up unexpectedly 
error: error in sideband demultiplexer 
To [email protected]:halftown.git 
    5d5e809..eb30e51 master -> master 
error: failed to push some refs to '[email protected]:git_application.git' 

請讓我知道如果您需要其他任何東西來幫助我解決此問題。

+0

可能重複[混帳與「邊帶信號分離器錯誤」響應] (http://stackoverflow.com/questions/4582849/git-responds-with-error-in-sideband-demultiplexer) – Amber 2012-03-06 22:30:20

+1

我原本以爲這是一個重複,但重置頭沒有解決它。我認爲我的問題是閱讀STDIN的問題。 – 2012-03-06 23:26:03

回答

16

我已經想通了我遇到的問題。顯然,在完成腳本之前,你必須確保你閱讀了STDIN的所有內容。

這是我後收到前鉤:

#!/bin/sh 
git checkout -f 

這是我補充說,解決了這個問題:

#!/bin/sh 
while read oldrev newrev refname 
do 
: 
done 
git checkout -f 
+0

不管你用什麼語言寫你的鉤子,只要確保你先閱讀了STDIN。 – 2012-03-06 23:30:26

+0

這對我很好。 – 2012-06-05 14:03:08