Skip to content

Commit 69cdc4c

Browse files
committed
Adding GitHubFlow major release docs and test
1 parent 7919345 commit 69cdc4c

File tree

3 files changed

+48
-2
lines changed

3 files changed

+48
-2
lines changed
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
# GitHubFlow Examples
22

33
## Feature branch
4-
![GitFlow](img/githubflow_feature-branch.png)
4+
![GitHubFlow](img/githubflow_feature-branch.png)
55

66
## Pull requests
7-
![GitFlow](img/githubflow_pull-request.png)
7+
![GitHubFlow](img/githubflow_pull-request.png)
8+
9+
## Release branch
10+
Release branches can be used in GitHubFlow as well as GitFlow. Sometimes you want to start on a large feature which may take a while to stabilise so you want to keep it off master. In these scenarios you can either create a long lived feature branch (if you do not know the version number this large feature will go into, and it's non-breaking) otherwise you can create a release branch for the next major version. You can then submit pull requests to the long lived feature branch or the release branch.
11+
12+
![GitFlow](img/githubflow_release-branch.png)
25.3 KB
Loading

src/GitVersionCore.Tests/IntegrationTests/DocumentationSamples.cs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,4 +367,45 @@ public void GitHubFlowPullRequestBranch()
367367
fixture.AssertFullSemver("1.2.1+3");
368368
}
369369
}
370+
371+
[Test]
372+
public void GitHubFlowMajorRelease()
373+
{
374+
using (var fixture = new EmptyRepositoryFixture(new Config()))
375+
{
376+
fixture.Participant("master");
377+
378+
fixture.Repository.MakeACommit();
379+
fixture.ApplyTag("1.3.0");
380+
381+
// Create release branch
382+
fixture.BranchTo("release/2.0.0", "release");
383+
fixture.Activate("release/2.0.0");
384+
fixture.MakeACommit();
385+
fixture.AssertFullSemver("2.0.0-beta.1+1");
386+
fixture.MakeACommit();
387+
fixture.AssertFullSemver("2.0.0-beta.1+2");
388+
389+
// Apply beta.1 tag should be exact tag
390+
fixture.ApplyTag("2.0.0-beta.1");
391+
fixture.AssertFullSemver("2.0.0-beta.1");
392+
393+
// Make a commit after a tag should bump up the beta
394+
fixture.MakeACommit();
395+
fixture.AssertFullSemver("2.0.0-beta.2+1");
396+
397+
// Complete release
398+
fixture.Checkout("master");
399+
fixture.MergeNoFF("release/2.0.0");
400+
fixture.Destroy("release/2.0.0");
401+
fixture.NoteOver("Release branches are deleted once merged", "release/2.0.0");
402+
403+
fixture.AssertFullSemver("2.0.0+0");
404+
fixture.ApplyTag("2.0.0");
405+
fixture.AssertFullSemver("2.0.0");
406+
fixture.MakeACommit();
407+
fixture.Repository.DumpGraph();
408+
fixture.AssertFullSemver("2.0.1+1");
409+
}
410+
}
370411
}

0 commit comments

Comments
 (0)