Search code examples
gitgithubgithub-actions

In GitHub how do I automatically force a feature branch to be up to date with the main branch


In GitHub there's a rule under the branch rule called Require branches to be up to date before merging. This is close to what I want but it doesn't automatically enforce the update until the user clicks on the button in the PR.

This is what I see when my feature branch is out of date from the Github UI enter image description here However I would like it so that this actually never shows up and instead automatically merges the latest changes from my main branch into my feature branch. I wanted to know if something like this was possible from the UI without using the command line


Solution

  • I assume this action is what you are looking for? https://github.com/marketplace/actions/auto-update

    autoupdate is a GitHub Action that auto-updates pull requests branches whenever changes land on their destination branch.