在推送到服务器后执行自动拉取请求 [英] Do an automatic pull request after pushing to server

查看:91
本文介绍了在推送到服务器后执行自动拉取请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当我提交并推送到服务器(git @ domain。)时,我已经在vps服务器上安装了gitlab,它也是我的远程服务器,用于提交本地更改。



在我的vps中,我有这个工作流程:

   -  var / www / 
- 项目(通过git克隆创建git@domain.com:root / project.git)
- 项目中的文件

当我对服务器进行推送时,我想让服务器自动从gitlab中提取更改。我也尝试过更新后的钩子,但这并不奏效。



我必须创建一个裸回购吗?或者我忘记了什么?

解决方案

project.git 裸露的回购协议,所以如果您有访问gitlab服务器,你可以到〜git / repositories / root / project.git / hooks 并添加你的 post-receive hook来强制部署。



请参阅通过git / gitolite权限部署网站/ webapp的示例错误例如。


I have installed gitlab on a vps server which is also my remote for committing my local changes.

When i commit and push to the server (git@domain.com:root/project.git), the code will be updated.

On my vps i have this workflow:

- var/www/
    - project (created through git clone git@domain.com:root/project.git)
        - Files within the project

When i do a push to the server, i want to let the server automatic pull the changes from gitlab. I also did a try with post-update hooks, but that doesn't work.

Do i have to create a bare repo ? Or did i forget something?

解决方案

project.git is a bare repo, so if you have access to the gitlab server, you can go to ~git/repositories/root/project.git/hooks and add your post-receive hook in order to force a deployment.

See an example in "deploying a website/webapp via git/gitolite permissions error" for instance.

这篇关于在推送到服务器后执行自动拉取请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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