-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Git Branches
The OpenAPI Generator project works on multiple versions in parallel:
- upcoming patch release
- next minor release containing breaking changes with fallback
- next major release containing breaking changes with no fallback
To support several versions, several branches are used:
Status in June 2018:
-
master
branch is for upcoming patch releases (3.0.1
,3.0.2
,3.0.3
, ...) -
3.1.x
branch for the next minor release -
4.0.x
branch for the next major release
To port changes from one branch to an other, the merge direction is always from the lowest version to the newer.
Example:
- Merge
master
branch into3.1.0
branch - Merge
3.1.0
branch into4.0.0
branch
Those merge commits are done regularly by the core team.
Merge commit is kept in the history in order to facilitate merge conflict resolution.
When we want to jump on the next version, the working branch is merged back:
Example (end of June 2018):
- When we drop the support for
3.0.x
, we'll merge3.1.x
back intomaster
:- There will be one last
3.0.x
release :3.0.3
(orange commit) - Then we merge
3.1.x
intomaster
, on the master branch the version is updated to3.1.0-SNAPSHOT
- The
master
branch is now use to do the next3.1.0
release and then weekly bugfix releases:3.1.1
,3.1.2
... - We can create the
3.2.x
branch to work on the next minor release3.2.0-SNAPSHOT
- There will be one last
Be careful of the merge direction. Keep merge commits as part of the history (no squash, ...).
Example for master
-> 3.1.x
branch:
git fetch
git checkout origin/3.1.x -B 3.1.x
git merge origin/master
Review the merge commit.
You can run some checks locally mvn clean verify
, bin/utils/ensure-up-to-date
...
git push
TODO, add useful git command, inspired by the discussion in https://github.com/OpenAPITools/openapi-generator/issues/245
- Edit the
if
condition in the.travis.yml
file to allow the working branches to do amvn deploy
of the artifacts - Set it as protected branch in the GitHub configs
- Update readme (branch list, badges…)