How to Update an Outdated Branch Without Creating a Merge Commit
So you have a pull request all ready to go, except for one small problem: your target branch has been updated and the pull request can no longer be merged cleanly. These video tutorials will walk you through using rebase to bring your feature branches up to date.
The most common workflow for updating an outdated branch may not be the best nor cleanest. There’s short, messy paths. There’s long paths with unnecessary steps.
The optimal flow can be described in two brief steps:
- Locally, rebase your changes on top of master.
- Update the branch in your remote repository.
See it demonstrated in this video:
Maybe you’ve tried rebasing before, but it didn’t go as smoothly as you would’ve liked. Often times you’ll encounter conflicts while rebasing your changes. The procedure for resolving these conflicts is not much different from that when resolving merge conflicts, but it can be daunting until you’ve done it a few times.
This video demonstrates how you can still update your branch without creating a merge commit, even when encountering conflicts. The procedure is the same whether you encounter one, two, or ten conflicts during your rebase. Just remember: “Keep Calm and Rebase On”.