Feature Branches
How-to for syncing long-running feature branches.
Sometimes we have long-running feature branches that can't be merged into master
yet because they contain breaking changes (e.g. sentry-sdk-2.0
, potel-base
). They have to be kept in sync with master
though.
You might be tempted to branch off the feature branch and do the merge there, maybe make a PR so that you can double check the changes in the UI and make sure CI is green. In that case you need to make sure you don't actually commit the merge from another branch — the merge commit needs to be directly on the feature branch, otherwise git
doesn't set the parent commits for the merge commit properly and the feature branch will still have unresolved conflicts (even though you literally just resolved them).
If you still want the nice GH diff and have CI run on your changes:
- check out the feature branch and
git merge master
into it - solve conflicts (while still on the feature branch)
- commit the merge (still on the feature branch)
- (if you're already confident all is good, you can just short circuit and push now, otherwise:)
- then open a new branch from your feature branch
git checkout -b sync-feature-with-master
- push the new branch, make a PR, look at the nice diff in GitHub, see if the tests pass
- if everything looks ok: don't merge the PR! this will not mark the merge conflicts as solved
- instead,
git checkout
your feature branch (with the merge commit on top) andpush
it
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").