1

After a branch has been merged to master on my fork I want to automatically merge master into the upstream repo's master.
If I can't do this, can I automatically create a new pull request from my fork's master to upstream's master?

EamonDawes
  • 65
  • 4

2 Answers2

1

After a branch has been merged to master on my fork I want to automatically merge master into the upstream repo's master.

If you are not the owner of upstream repository, you can use pull request, but you can not do it automatically.

If you are the owner of upstream repository, you can use merge, but you can not do it automatically (you can use script for automatic, some thing likes this: https://github.com/pivotalsoftware/auto-merge-upstream).

But your wish is irrational. Why you don't commit directly to upstream, you don't need what called automatic, because the result is the same.

If I can't do this, can I automatically create a new pull request from my fork's master to upstream's master?

Of course.

Do Nhu Vy
  • 33,131
  • 37
  • 143
  • 202
0

You could setup a post-commit hook, trigger after creation of the merge commit.

That hook will have to test if the commit made is a merge commit or not.
If it is, and if the current branch is master, then a simple git push upstream can proceed.
That is, if you are the owner of the upstream repo.

If not, you will have to:

VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283