I'm managing a site using the setup in this article: http://toroid.org/git-website-howto
It has been working great for several years but I recently moved the site to AWS and had to reconfigure the remote repo. Here is my setup:
The hook contains the following:
#!/bin/sh
GIT_WORK_TREE=/path/to/destination/folder/for/checkout git checkout -f
Whenever I try running the hook (from the root of the bare remote repo):
./hooks/post-receive
I get
fatal: This operation must be run in a work tree
I have tried making the remote repo NOT bare, but that did not work. I am on Ubuntu 14.04 using git 2.5.8
Any help or pointers appreciated!
答案 0 :(得分:0)
我通过将最终目的地视为存储库来解决这个问题(因为它实际上是lol)所以现在post-receive挂钩看起来像这样:
#!/bin/sh
cd /final/destination/path
git checkout origin -f