Skip to content

Commit 730508a

Browse files
committed
Merge pull request #516 from JakeGinnivan/MoreDocImprovements
[WIP] More doc improvements
2 parents a0d3d13 + 36b5f9a commit 730508a

21 files changed

+102
-27
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Converting to GitFlow
2+
Converting to GitFlow is simple. Whenever you need to convert, simply do the following
3+
4+
```
5+
git checkout master
6+
git checkout -b develop
7+
git push upstream develop
8+
```
9+
10+
Then in GitHub go to your repository settings then set develop to be your default branch. And now all development happens on the `develop` branch

Docs/branchingStrategies/gitFlow.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#GitFlow
22
GitFlow allows more structured releases, and GitVersion will derive sensible SemVer compatible versions from this structure.
33

4-
### Assumptions:
4+
## Resources
5+
6+
## Assumptions:
57

68
* Using [GitFlow branching model](http://nvie.com/git-model/) which always has a master and a develop branch
79
* Following [Semantic Versioning](http://semver.org/)
@@ -12,14 +14,14 @@ GitFlow allows more structured releases, and GitVersion will derive sensible Sem
1214
* Tags can also be used to override versions while we transition repositories over to GitVersion
1315
* Using a build server with multi-branch building enabled eg TeamCity 8
1416

15-
### How Branches are handled
17+
## How Branches are handled
1618

1719
The descriptions of how commits and branches are versioned can be considered a type of pseudopod. With that in mind there are a few common "variables" that we will refer to:
1820

1921
* `targetBranch` => the branch we are targeting
2022
* `targetCommit` => the commit we are targeting on `targetbranch`
2123

22-
#### Master branch
24+
### Master branch
2325

2426
Commits on master will always be a merge commit (Either from a `hotfix` or a `release` branch) or a tag. As such we can simply take the commit message or tag message.
2527

@@ -41,7 +43,7 @@ Long version:
4143
{major}.{minor}.{patch} Sha:'{sha}'
4244
1.2.3 Sha:'a682956dccae752aa24597a0f5cd939f93614509'
4345

44-
#### Develop branch
46+
### Develop branch
4547

4648
`targetCommitDate` => the date of the `targetCommit`
4749
`masterVersionCommit` => the first version (merge commit or SemVer tag) on `master` that is older than the `targetCommitDate`
@@ -57,7 +59,7 @@ Long version:
5759
{major}.{minor}.{patch}-{pre-release} Branch:'{branchName}' Sha:'{sha}'
5860
1.2.3-unstable645 Branch:'develop' Sha:'a682956dccae752aa24597a0f5cd939f93614509'
5961

60-
#### Hotfix branches
62+
### Hotfix branches
6163

6264
Named: `hotfix-{versionNumber}` eg `hotfix-1.2`
6365

@@ -73,7 +75,7 @@ Long version:
7375
{major}.{minor}.{patch}-{pre-release} Branch:'{branchName}' Sha:'{sha}'
7476
1.2.3-beta645 Branch:'hotfix-foo' Sha:'a682956dccae752aa24597a0f5cd939f93614509'
7577

76-
#### Release branches
78+
### Release branches
7779

7880
* May branch off from: develop
7981
* Must merge back into: develop and master
@@ -95,7 +97,7 @@ Long version:
9597
1.2.3-alpha2.4 Branch:'release-1.2' Sha:'a682956dccae752aa24597a0f5cd939f93614509'
9698
1.2.3-rc2 Branch:'release-1.2' Sha:'a682956dccae752aa24597a0f5cd939f93614509'
9799

98-
#### Feature branches
100+
### Feature branches
99101

100102
May branch off from: `develop`
101103
Must merge back into: `develop`
@@ -114,7 +116,7 @@ Long version:
114116
{major}.{minor}.{patch}-{pre-release} Branch:'{branchName}' Sha:'{sha}'
115117
1.2.3-unstable.feature-a682956d Branch:'feature1' Sha:'a682956dccae752aa24597a0f5cd939f93614509'
116118

117-
#### Pull-request branches
119+
### Pull-request branches
118120

119121
May branch off from: `develop`
120122
Must merge back into: `develop`
@@ -125,7 +127,7 @@ Branch naming convention: anything except `master`, `develop`, `release-{n}`, or
125127
* patch: 0
126128
* pre-release: `unstable.pull{n}` where n = the pull request number ('0' padded to 4 characters)
127129

128-
### Nightly Builds
130+
## Nightly Builds
129131

130132
**develop**, **feature** and **pull-request** builds are considered nightly builds and as such are not in strict adherence to SemVer.
131133

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# GitFlow Examples
2+
## Continuous Delivery mode
3+
TODO Example of GitFlow using continuous delivery mode
4+
5+
## Continuous Deployment mode
6+
TODO Example of GitFlow using continuous deployment mode
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# GitHub Flow
2+
GitHub Flow is a simple and effective branching strategy which the folks at GitHub use. Most teams actually do not need everything GitFlow gives them and are much better off with a simpler workflow.
3+
4+
GitHub Flow is in a nutshell:
5+
6+
1) Update master to latest [upstream](../Reference/gitSetup.md#upstream) code
7+
2) Create a feature branch `git checkout -b myFeatureBranch`
8+
3) Do the feature/work
9+
4) Push feature branch to [origin](../Reference/gitSetup.md#origin)
10+
5) Create pull request from origin/<featureBranch> -> upstream/master
11+
6) Review, fix raised comments, merge your PR or even better, get someone else to.
12+
13+
The main rule of GitHub Flow is that master should *always* be deployable. GitHub Flow allows and encourages [continuous deliver](../Reference/Continuous-Delivery.md).
14+
15+
## Resources
16+
- [GitHubFlow guide by GitHub](https://guides.github.com/introduction/flow/index.html)
17+
- [GitHub Flow original blog post](http://scottchacon.com/2011/08/31/github-flow.html)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# GitHubFlow Examples
2+
## Continuous Delivery mode
3+
TODO Example of GitHubFlow using continuous delivery mode
4+
5+
## Continuous Deployment mode
6+
TODO Example of GitHubFlow using continuous deployment mode
83.8 KB
Loading

Docs/branchingStrategies/readme.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,35 @@
1-
This folder contains notes about different branching strategies and how they work in GitVersion
1+
# Branching strategies
2+
There are two mainstream branching strategies in git and many lesser known strategies.
3+
4+
When building GitVersion we had to work through not only how to use the branching strategies but how we could fully support semantic versioning in each of these strategies.
5+
6+
## Introduction to branching strategies
7+
Git is a very powerful tool and if you do not settle on a branching strategy and associated workflows then you will likely lose work at some point. At the start of any project I recommend picking a branching strategy and making sure your whole team understands it.
8+
9+
As mentioned above the GitVersion docs cover GitHubFlow and GitFlow.
10+
11+
### GitHubFlow
12+
GitHubFlow is a simple and powerful branching strategy. It is what GitHub uses and the branching strategy most open source projects use.
13+
14+
- [Mainline development](../Reference/mainline-development.md) on `master`
15+
- Work on [feature branches](../Reference/featureBranches.md), merge into `master` via [pull requests](../Reference/pull-requests.md)
16+
- Works well for [continuous delivery](../Reference/Continuous-Delivery.md)
17+
- Does not have a way to manage/maintain old releases
18+
- Only allows working on a single release at a time
19+
20+
### GitFlow
21+
GitFlow is a more complex and complete branching strategy. It also gives much more control over when features and code is released.
22+
23+
- Development on `develop` branch
24+
- `master` only contains *released* code
25+
- Supports maintaining old releases (like nServiceBus, they support the last 3 major versions with bug fixes and security updates)
26+
- Supports development on multiple releases at one time
27+
28+
## Choosing a branching strategy
29+
There are a few reasons you would pick GitFlow over GitHubFlow, they are:
30+
31+
1) You need to support multiple major versions at the same time
32+
2) You need to work on multiple releases at the same time
33+
- For example a new feature which will go in the next major version, while bug fixes/smaller features are still going into the current release
34+
35+
But if you do not have a good reason to go with GitFlow, then start with GitHubFlow. It is a far simpler model and if you end up needing GitFlow later, it is [easy to convert](convertingToGitFlow.md)

Docs/buildServers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ For instance if you are running in TeamCity after you run `GitVersion /output bu
1212
When running in MSBuild either from the MSBuild Task or by using the `/proj myproject.sln` GitVersion will make the MSBuild variables available in the format `$(GitVersion_SemVer)`.
1313

1414
## Setup guides
15-
- [AppVeyor](buildServerSetup/appVeyor.md)
15+
- [AppVeyor](buildServerSetup/AppVeyor.md)
1616
- [TeamCity](buildServerSetup/teamCity.md)
1717

1818
## Other plugins/helpers

Docs/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ The configuration options are:
1717

1818
- `next-version`: Allows you to bump the next version explicitly, useful for bumping `master` or a feature with breaking changes a major increment.
1919
- `assembly-versioning-scheme`: When updating assembly info tells GitVersion how to treat the AssemblyVersion attribute. Useful to lock the major when using Strong Naming.
20-
- `mode`: Either ContinuousDelivery or ContinuousDeployment. See [Octopus Deploy/CI Build NuGet Packages](#continuousdeployment) above for more information
21-
- `continuous-delivery-fallback-tag`: When using `mode: ContinuousDeployment` the value specified will be used as the pre-release tag for branches which do not have one specified.
20+
- `mode`: Either Continuous-Delivery or ContinuousDeployment. See [Octopus Deploy/CI Build NuGet Packages](#continuousdeployment) above for more information
21+
- `Continuous-Delivery-fallback-tag`: When using `mode: ContinuousDeployment` the value specified will be used as the pre-release tag for branches which do not have one specified.
2222
- `tag-prefix`: A regex which is used to trim git tags before processing (eg v1.0.0). Default is `[vV]` though this is just for illustrative purposes as we do a IgnoreCase match and could be `v`
2323

2424
## Branch configuration

Docs/examples.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Examples
2-
## Overview
32
![README](images/CommitGraph.png)
43

54
At each commit sha GitVersion will calculate:
@@ -28,15 +27,7 @@ This is just a small sample of the way GitVersion works. The idea is you just pl
2827
If you have other branch types GitVersion is entirely configuration driven, so check out the [Configuration](#Configuration) section of the readme to understand how to make GitVersion work for you.
2928

3029
## GitFlow
31-
### Continuous Delivery mode
32-
TODO Example of GitFlow using continuous delivery mode
33-
34-
### Continuous Deployment mode
35-
TODO Example of GitFlow using continuous deployment mode
30+
[See GitFlow Examples](branchingStrategies/gitFlowExamples.md)
3631

3732
## GitHubFlow
38-
### Continuous Delivery mode
39-
TODO Example of GitHubFlow using continuous delivery mode
40-
41-
### Continuous Deployment mode
42-
TODO Example of GitHubFlow using continuous deployment mode
33+
[See GitHubFlow Examples](branchingStrategies/gitHubFlowExamples.md)

Docs/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
GitVersion calculates the semantic version, this will only change once per *release*. Read more at [version increments](./versionIncrements.md)
55

66
## How can GitVersion run for a shallow clone or checkout on server working directories
7-
GitVersion needs a proper git repository to run, some build servers do not do a proper clone which can cause issues. GitVersion has a feature called [dynamic repositories](dynamicRepositories.md) which solves this by cloning the repository and working against that clone instead of the working directory.
7+
GitVersion needs a proper git repository to run, some build servers do not do a proper clone which can cause issues. GitVersion has a feature called [dynamic repositories](Dynamic-Repositories.md) which solves this by cloning the repository and working against that clone instead of the working directory.
88

99
## I don't understand what SemVer is all about
1010
Not a problem, we have a quick introduction to SemVer which can be a good primer to read before reading [SemVer.org](http://semver.org)

Docs/buildServerSetup/appVeyor.md renamed to docs/Build-Server-Setup/AppVeyor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ AppVeyor is the first build server which has a setup helper built into `GitVersi
44
1. Run `GitVersion init`
55
2. Choose `Setup build scripts` (currently option 7, but that could change)
66
3. Choose `AppVeyor`
7-
4. Follow the prompts to generate an appveyor.yml file which works nicely with GitVersion
7+
4. Follow the prompts to generate an AppVeyor.yml file which works nicely with GitVersion

Docs/buildServerSetup/teamCity.md renamed to docs/Build-Server-Setup/teamCity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ GitVersion writes system parameters into TeamCity, so they will automatically be
1313

1414
## Running inside TeamCity
1515
* Make sure to use **agent checkouts** (required, server checkouts do not copy the needed `.git` directory)
16-
- If you want to use *checkout on server*, see [dynamic repositories](dynamicRepositories.md)
16+
- If you want to use *checkout on server*, see [dynamic repositories](Dynamic-Repositories.md)
1717
* For the moment you need to promote the `%teamcity.build.vcs.branch.{configurationid}%` build parameter to an environment variable with the same name for pull requests to be handled correctly
1818
* We update the TC build number to the GitVersion number automatically
1919
* We output the individual values of the GitVersion version as the build parameter: `GitVersion.*` (Eg: `GitVersion.Major`) if you need access to them in your build script

docs/Reference/Continuous-Delivery.md

Whitespace-only changes.

docs/Reference/continuous-deployment.md

Whitespace-only changes.

docs/Reference/feature-branches.md

Whitespace-only changes.

docs/Reference/git-setup.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Git setup
2+
3+
## Remotes
4+
### upstream
5+
`upstream` should point at the main repository. Your workflow should be to fetch/pull from upstream. Update your local branches, then start working on a newly created feature branch
6+
7+
### origin
8+
`origin` should point to your *fork*.

docs/Reference/mainline-development.md

Whitespace-only changes.

docs/Reference/pull-requests.md

Whitespace-only changes.

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
theme: readthedocs

0 commit comments

Comments
 (0)