Git Push Server 不更新工作分支 [英] Git Push Server doesn't update working branch

查看:64
本文介绍了Git Push Server 不更新工作分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想

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?

我试着把

cd ..
env -i git reset --hard

在 post-receive 钩子中,但它似乎没有做任何事情.(从这里得到这个想法:http://philsturgeon.co.uk/news/2010/02/Deploying-websites-with-Git)

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)

感谢帮助.

推荐答案

你应该改用这个方法.http://toroid.org/ams/git-website-howto 它仍然使用post-receive hook 但有不同的实现细节.

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.

另外你用什么方法推送到repo?如果您使用 HTTP 而不是 SSH,那么根据您的设置,钩子可能永远不会执行.

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 Server 不更新工作分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆