Can GitHub automatically merge branches?

微笑、不失礼 提交于 2021-02-17 17:56:15

问题


We want to automatically merge out from master to another long-lived branch whenever any changes are committed to master (at the moment, this is a manual process and people forget)

I appreciate that it may not always be possible, owing to merge conflicts, but if it is possible, we'd like it to happen automatically.

Is this possible?


回答1:


Is available since 2020-12-16

The native GitHub Auto-Merge was introduced on GitHub Universe 2 days ago.

How to active them? Go to Settings of your repository, e.g. https://github.com/rectorphp/rector/settings, then ↓


Tip: do you want to prevent merged branch piling up? Enable autobranch removal too


Source

While it might not be solely what you need to you for your use case, it can be used with GitHub Actions to get there more easily.




回答2:


I've been using https://github.com/marketplace/actions/merge-pull-requests for a while and it works pretty well. In that page you have the instructions on how to use it.

If you need more specific workflows, you can try https://mergify.io/ also.



来源:https://stackoverflow.com/questions/35445186/can-github-automatically-merge-branches

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