2012-07-21 18 views
1

我試圖創建一個單獨的工作樹的Git倉庫。我遵循本教程的信:http://caiustheory.com/automatically-deploying-website-from-remote-git-repository文件不更新與自定義工作樹在Git

我能夠從我的本地回購承諾並推送到我的遠程。我已經指定爲工作樹的文件路徑不包含我推送的文件。

我在考慮文件路徑可能不正確(我在MediaTemple GS上),但是當我按下Git時不會拋出任何錯誤。

下面是從我遠程的配置:

[core] 
repositoryformatversion = 0 
filemode = true 
bare = false 
worktree = /home/xxxxx/domains/xxxxxx.com/html/b 

[receive] 
denycurrentbranch = ignore 

我的後接收和post-update掛鉤均爲777都包含這樣的:

#!/bin/sh 
git checkout -f 

我會真正體會到任何幫助提供。

感謝,

--Nick

回答

1

你會想是這樣的:

https://github.com/richo/git_template/blob/master/hooks/post-receive

或者更簡潔地說:

#!/bin/sh 

# Kludge to read the last ref 
while read old new ref; do 
real_sha=$new 
done 

GIT_WORK_TREE=$PWD/../ git checkout -qf $real_sha 

基本上,新的裁判在stdin中傳入post-receive,所以你需要手動讀取它們。

你的鉤子正在做什麼是強制檢查現有的參考。