Skip to content

Instantly share code, notes, and snippets.

@dwatts1772
Last active April 29, 2022 00:34
Show Gist options
  • Save dwatts1772/45df7fb1e0d7caa8168b7b56ae113714 to your computer and use it in GitHub Desktop.
Save dwatts1772/45df7fb1e0d7caa8168b7b56ae113714 to your computer and use it in GitHub Desktop.
Git Releases Tags

https://nvie.com/posts/a-successful-git-branching-model/

New Feature

git checkout develop
git checkout -b new-feature
# PR to merge new-feature

Create Release Branch

$ git checkout origin develop
$ git pull origin develop
$ git checkout -b release-1.2
# Create Pull Request and deploy release-1.2 to staging/testing environment for client testing 

Fixes to Release Branch

# Bug is foudn in release
$ git checkout origin release-1.2
$ git checkout -b release/JIRA-1234
# make fixes.
# Create Pull Request to merge back into release-1.2

# Merge release/JIRA-1234 back into develop branch as well
$ git checkout develop
$ git merge release/JIRA-1234 --no-ff

Hotfixes

$ git checkout -b hotfix/JIRA-321 master
# make changes
# Open Pull Request into master and merge

# Merge hotfix/JIRA-321 into any current release branch as well as develop
$ git checkout release-1.7
$ git merge hotfix/JIRA-321 --no-ff
$ git checkout develop
$ git merge hotfix/JIRA-321 --no-ff

# Increment version, create git tag and create Release in Github
$ git checkout origin master
$ yarn release # uses https://www.npmjs.com/package/release-it
# Should be a Patch release 1.2.0 to 1.2.1

Finishing a Release

# After a release branch has been merged into master using a pull request
$ git checkout master
$ yarn release (uses https://www.npmjs.com/package/release-it)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment