Git Push Server doesn't update working branch

2019-08-21 19:58发布

问题:

I want to

git push server master

And then have it update the files on the webserver for rapid deployment. But the files on the server don't get updated. There isn't a new branch oder anything. How do I get the files on the working branch once they have arrived?

I tried putting

cd ..
env -i git reset --hard

in the post-receive hook but it doesn't seem to do anything. (Got that idea from here: http://philsturgeon.co.uk/news/2010/02/Deploying-websites-with-Git)

Help appreciated.

回答1:

You should use this method instead. http://toroid.org/ams/git-website-howto It still uses a post-receive hook but had different implementation details.

Additionally what method are you using to push to the repo? If you are using HTTP instead of SSH then depending on your setup, the hooks may never be executed.



标签: git push