Can forks be synced automatically in gitHub?

一个人想着一个人 提交于 2019-11-28 16:52:15

You could define a webhook to listen to upstream (the original repo) changes, and update your fork.

In June 2016, you now have the service backstroke.us which listens to those events for you. No need to write your own listener.
See 1egoman/backstroke

  1. Create a webhook in either a fork or a upstream repository. (Settings => Webhooks & Services => Add Webhook)
  2. Add http://backstroke.us as the payload url.
  3. Push some code to the upstream repository to see Backstroke in action.

In your case, you would need to convince the maintainer of the upstream repo (the one you have forked) to register that backstroke webhook.
You will see PR (pull requests) appear automatically on your fork, for you to accept (keeping you in sync with any evolution done on the original repo side).

With GitHub alone, you cannot sync forks automatically. You can, however, sync forks manually.

You could also use the GitHub API to write a bot that syncs forks whenever upstream repositories are updated.

You can create a Github App that use Github API to check the upstream repo periodically. Once an update is found, use Github API to create a pull request then call updateRef to update your branch to match master.

Or, just install this Github App that does exactly that

https://github.com/wei/pull

🤖 a GitHub App that keeps your repository up-to-date with upstream changes.

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