Pergunta

I have been through many many many answers but nothing is giving any results.

Basically post-receive is never being called. This is the script inside /home/git/repo.git/hooks/post-receive

#!/bin/sh
2>&1 > "post-receive.log"
cd /home/ubuntu/project
git checkout -f master

We want to check out to /home/ubuntu/project

There is an Ubuntu server with a user called ubuntu. There is also a user called git. We clone/push/pull etc against a repository under the git user.

sudo chmod +x post-receive is done.

The git user is a sudoer.

So when there is a push with changes! nothing happens. post-receive.log is not even created. I can run the script manually on the server as the git user. Not as the Ubuntu user...

Foi útil?

Solução

Re-created the repo using just the Ubuntu user. Not sure what might have been going on with the Git user, you may have been right, torek.

For those who are facing a similar issue and are using a different user account for Git then try the following tutorial - all under the one user.

http://caiustheory.com/automatically-deploying-website-from-remote-git-repository

However please note we had to set the core.worktree after the core.bare configuration.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top