Skip to content

Commit c37b1e7

Browse files
committed
Documenting the git flow workflow and create sequence diagrams
1 parent 7b06726 commit c37b1e7

18 files changed

+166
-53
lines changed
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

docs/input/docs/learn/branching-strategies/gitflow/examples.md

Lines changed: 57 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,61 +6,79 @@ RedirectFrom:
66
- docs/git-branching-strategies/gitflow-examples
77
---
88

9-
These examples are using the _default_ configuration with GitVersion. Which is
10-
[continuous deployment](/docs/reference/modes/continuous-deployment) mode for
11-
`develop` and [continuous delivery](/docs/reference/modes/continuous-delivery) mode
12-
for all other branches.
13-
14-
This default configuration allows you to publish CI builds from develop to a CI
15-
MyGet feed, or another CI feed. Then all other branches are manually released
16-
then tagged. Read more about this at [version increments](/docs/reference/version-increments).
9+
These examples are illustrating the usage of the supported `GitFlow` workflow in GitVersion.
10+
To enable this workflow, the build-in template [GitFlow/v1](/docs/workflows/GitFlow/v1.json) needs to be referenced in the configuration as following:
11+
```yaml
12+
workflow: GitFlow/v1
13+
mode: ContinuousDelivery
14+
```
15+
16+
Where
17+
the [continuous deployment](/docs/reference/modes/continuous-deployment) mode for no branches,
18+
the [continuous delivery](/docs/reference/modes/continuous-delivery) mode for `main`, `support` and `develop` branches and
19+
the [manual deployment](/docs/reference/modes/manual-deployment) mode for `release`, `feature`, `hotfix` and `unknown` branches
20+
are specified.
21+
22+
This configuration allows you to publish CI (Continuous Integration) builds from `main`, `support` and `develop` branches to an artifact repository.
23+
All other branches are manually published. Read more about this at [version increments](/docs/reference/version-increments).
24+
25+
__Notice:__ The _continuous delivery_ mode has been used for the `main` and the `support` branch in this examples (specified as a fallback on the root configuration layer)
26+
to illustrate how the version increments are applying. In production context the _continuous deployment_ mode might be a better option when e.g.
27+
the releasing process is automated or the commits are tagged by the pipeline automatically.
1728

1829
## Feature Branches
1930

20-
Feature branches will take the feature branch name and use that as the
21-
pre-release tag.
31+
Feature branches can be used in the `GitFlow` workflow to implement a feature in an isolated environement. Feature branches will take the feature branch name and use that
32+
as the pre-release label. Will be created from `develop`, `release`, `main`, `support` or `hotfix` branches.
2233

23-
![GitFlow](/docs/img/05119d0cd4ecaaefff94\_feature-branch.png)
34+
### Create feature branch from main
2435

25-
Notice after the feature branch is merged, the version on `develop` is
26-
`1.3.0-alpha.3`. This is due to `develop` running in _continuous deployment_
27-
mode. If you configured `develop` to use _continuous delivery_ the version would
28-
still be `1.3.0-alpha.1` and you would have to use release tags to increment the
29-
`alpha.1`.
36+
![GitFlow](/docs/img/DocumentationSamplesForGitFlow\_FeatureFromMainBranch.png)
3037

31-
You can see the difference on the feature branch itself, notice the version is
32-
the same before and after the commit on the feature branch? Only the metadata
33-
has changed. If you released the feature branch artifacts then tagged the
34-
commit, the following commit would increase to `-beta.2`.
38+
__Notice:__ After the feature branch is merged, the version on `main` is
39+
`2.0.0-5`. This is due to `main` running in _continuous delivery_
40+
mode. If you configured `main` to use _continuous deployment_ the version would
41+
be `2.0.0`.
3542

36-
## Pull Request
43+
### Create feature branch from develop
3744

38-
Because feature branches are most likely pushed to a fork, we are showing the
39-
pull request branch name which is created when you submit a pull request
45+
![GitFlow](/docs/img/DocumentationSamplesForGitFlow\_FeatureFromDevelopBranch.png)
4046

41-
![GitFlow](/docs/img/09fdf46995b771f3164a_pull-request.png)
47+
__Notice:__ After the feature branch is merged, the version on `develop` is
48+
`1.3.0-alpha.3`. This is due to `develop` running in _continuous delivery_
49+
mode. If you configure `develop` to use _manual deployment_ the version would
50+
still be `1.3.0-alpha.1` and you would have to use pre-release tags to increment the
51+
`alpha.1`.
4252

4353
## Hotfix Branches
4454

45-
Hotfix branches are used when you need to do a _patch_ release in GitFlow and
46-
are always created off `main`
55+
Hotfix branches are used when you need to do a _patch_ release in the `GitFlow` workflow and are always created from `main` branch.
56+
57+
### Create hotfix branch
58+
59+
![GitFlow](/docs/img/DocumentationSamplesForGitFlow\_HotfixBranch.png)
4760

48-
![GitFlow](/docs/img/f26ae57adbd9b74f74c4\_hotfix.png)
61+
### Create hotfix branch with version number
4962

50-
## Minor Release Branches
63+
![GitFlow](/docs/img/DocumentationSamplesForGitFlow\_VersionedHotfixBranch.png)
5164

52-
Release branches are used for both major and minor releases for stabilisation
53-
before a release. Release branches are taken off `develop` then merged to both
54-
`develop` and `main`. Finally `main` is tagged with the released version.
65+
## Release Branches
5566

56-
![GitFlow](/docs/img/6d33d35a70a777608fa1\_minor-release.png)
67+
Release branches are used for major and minor releases to stabilize a RC (Release Candidate) or to integrate
68+
features (in parallel) targeting different iterations. Release branches are taken from `main` (or from `develop`)
69+
and will be merged back afterwards. Finally the `main` branch is tagged with the released version.
5770

58-
## Major Release Branches
71+
### Create release branch
5972

60-
Major releases are just like minor releases, the difference is you bump the
61-
major in the release branch name.
73+
![GitFlow](/docs/img/DocumentationSamplesForGitFlow\_ReleaseBranch.png)
6274

63-
![GitFlow](/docs/img/39f9d8b8b007c82f1f80\_major-release.png)
75+
### Create release branch with version
76+
77+
![GitFlow](/docs/img/DocumentationSamplesForGitFlow\_VersionedReleaseBranch.png)
78+
79+
## Develop Branch
80+
81+
![GitFlow](/docs/img/DocumentationSamplesForGitFlow\_DevelopBranch.png)
6482

6583
## Support Branches
6684

@@ -71,23 +89,17 @@ majors, then name your branch `support/<major>.x` (i.e `support/1.x`), to
7189
support minors use `support/<major>.<minor>.x` or `support/<major>.<minor>.0`.
7290
(i.e `support/1.3.x` or `support/1.3.0`)
7391

74-
### Hotfix
92+
![GitFlow](/docs/img/DocumentationSamplesForGitFlow\_SupportBranch.png)
7593

76-
Depending on what you name your support branch, you may or may not need a hotfix
94+
__Notice:__ Depending on what you name your support branch, you may or may not need a hotfix
7795
branch. Naming it `support/1.x` will automatically bump the patch, if you name
7896
it `support/1.3.0` then the version in branch name rule will kick in and the
7997
patch _will not_ automatically bump, meaning you have to use hotfix branches.
80-
![GitFlow](/docs/img/b035b8ca99bd34239518\_support-hotfix.png)
81-
82-
### Minor Release
83-
84-
![GitFlow](/docs/img/2167fb1c4a5cf84edfd8\_support-minor.png)
8598

8699
## To Contribute
87100

88101
See [contributing examples](/docs/learn/branching-strategies/contribute-examples).
89102

90103
### Source
91104

92-
See `DocumentationSamples.GitFlowExample`. To update, modify then run test.
93-
Update <https://gist.github.com/JakeGinnivan/cf053d7f5d336ae9f7bb>
105+
See `DocumentationSamplesForGitFlow.cs`. To update, modify then run test.

docs/input/docs/reference/configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ strategies:
7070
- VersionInBranchName
7171
branches:
7272
develop:
73+
mode: ContinuousDelivery
7374
label: alpha
7475
increment: Minor
7576
prevent-increment:

0 commit comments

Comments
 (0)