Skip to content

Describe automatically create merge-up branches #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,34 +77,39 @@ the current default release branch via merge-ups.
### Releasing

When releasing a new version `x.y.z`, a new branch will be created `x.y+1.z` and will be set as the next
default release branch.
default release branch. If a hotfix `x.y.z+1` is released, a merge-up branch is automatically created.

### Synchronizing branches

To keep branches synchronized merge-ups are used.

That consists in getting the changes of a specific released branch merged all the way up to the current
default branch. This ensures that all release branches are up-to-date and will never present a bug which
has already been fixed.
has already been fixed. Merge-up branches are automatically created but needs to be merged manually into
the targeted branch.

**Example**

Let's say we've released the versions `1.0.0` and `1.1.0`.
New features are being developed on `1.2.x`.
After a couple weeks, a bug was found on version `1.0.0`.

The fix for that bug should be done based on the branch `1.0.x` and, once merged, the branches should be updated in this way:
The fix for that bug should be done based on the branch `1.0.x` and, once merged, the branches should be updated
in this way:

1. Create a branch from the fixed `1.0.x` (`git checkout 1.0.x && git checkout -b merge-up/1.0.x-into-1.1.x`)
1. Create a PR using `1.1.x` as destination
1. Create a branch from the fixed `1.1.x` (`git checkout 1.1.x && git checkout -b merge-up/1.1.x-into-1.2.x`)
1. Create a PR using `1.2.x` as destination
1. Create a PR for the automatically created branch `1.0.x-merge-up-into-1.1.x_*`, using `1.1.x` as destination.
1. Merge the new PR into `1.1.x`.
1. Create a PR for the automatically created branch `1.1.x-merge-up-into-1.2.x_*`, using `1.2.x` as destination.
1. Merge the new PR into `1.2.x`.

:warning: when the merge-up can't be merged due to conflicts, it needs to be synced with the destination branch.
That's done by merging the destination into the merge-up branch and resolving the conflicts locally:

1. Checkout to merge-up branch (`git checkout -b merge-up/1.1.x-into-1.2.x`)
1. Update your local repository (`git fetch origin`)
1. Checkout to merge-up branch (`git checkout 1.1.x-merge-up-into-1.2.x_*`)
1. Sync merge-up branch (`git merge --no-ff origin/1.2.x`)
1. Solve conflicts (using `git mergetool` or through an IDE)
1. Resume merge (`git merge --continue`)
1. Push (`git push`)

If needed you can create a merge-up branch manually: `git checkout 1.0.x && git checkout -b 1.0.x-merge-up-into-1.1.x`