Git Push Server doesn't update working branch

元气小坏坏 提交于 2019-12-25 06:37:55

问题


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.



来源:https://stackoverflow.com/questions/4958545/git-push-server-doesnt-update-working-branch

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!