Skip to content

Instantly share code, notes, and snippets.

@transcendr
Last active August 30, 2019 11:36
Show Gist options
  • Save transcendr/9a94ebc035e6c3b4ae240e178725ac34 to your computer and use it in GitHub Desktop.
Save transcendr/9a94ebc035e6c3b4ae240e178725ac34 to your computer and use it in GitHub Desktop.
Git Flow Examples

We started this feature with:

git flow feature start example-1

We added a new file here as an example feature.

Now we will commit these changes.

git commit -am "Feature example 1 change"

Now we make another change and commit them as well:

git commit -am "Another feature example 1 change"


We left this feature to go work on another feature (example-2). We completed the Example 2 feature, merging it back to develop and bumping version + tagging.

Now we want to make sure that this feature branch is up to date with the latest in the develop branch, so that we can have example-2 feature as we are developing feature example-1.

git rebase develop

Now that we have imported the latest from develop, we go about continuing work on this feature, making commits along the way.

git commit -am "More changes to example-1"

We were working on feature 1, but now have started a new concurrent feature.

Imagining that we were in the feature 1 branch, we commit all changes in that branch and then checkout to develop:

git checkout develop

Once in develop, we start our new feature:

git flow feature start example-2

Now we are here making changes. We commit these changes:

git commit -am "Example 2 change"

We have completed this feature so we finish it:

git flow feature finish example-2

Once the feature branch has been finished, it merges back to develop and we are in develop branch.

At this point, we bump the version, and apply a tag. For a feature, the last number gets incremented by 1:

1.0.18 -> 1.0.19

We then commit the bump and tag it:

git commit -am "Bumps version to 1.0.19"

git tag 1.0.19

We then push the changes to origin/develop along with the tag

git push origin develop && git push --tags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment