Whenever the master branch is updated I want all open pull requests to show the option of Update branch as shown below. How do I do that?
Whenever the master branch is updated I want all open pull requests to show the option of Update branch as shown below. How do I do that?
This configuration is part of the protected branches option. You can create a protected branch in the repository settings and then select “Require status checks to pass before merging” and then “Require branches to be up to date before merging.”
Note that this option is the only way to get this button; if you don't want to prevent people from merging out-of-date branches, then this button won't be available. I generally recommend not setting this option unless you have a good reason since it can make merging changes difficult if someone else merges before you, especially on busy repositories.
As of February 2022 this is possible without having the "Require branches to be up to date before merging" setting on. The new setting is called "Always suggest updating pull request branches". See the "Always have the option to update" section here: https://github.blog/changelog/2022-02-03-more-ways-to-keep-your-pull-request-branch-up-to-date/