Skip to content

Instantly share code, notes, and snippets.

@knutov
Forked from denji/Git-flow_Cheat_Sheet.md
Created August 11, 2020 22:37
Show Gist options
  • Save knutov/138ed1ff64cfe26a748f4863cb14c888 to your computer and use it in GitHub Desktop.
Save knutov/138ed1ff64cfe26a748f4863cb14c888 to your computer and use it in GitHub Desktop.
Git-flow Cheat Sheet

Initialize a Repository for git-flow

git flow init -d

(Omit -d if you want to select values other than the defaults.)

Features

Start a New Feature

This creates a new branch based on develop and switches to it:

git flow feature start FEATURENAME

Finish a Feature

This merges the feature into develop, removes the feature branch, and switches to develop:

git flow feature finish FEATURENAME

Publish a Feature

Push a feature branch to remote repository:

git flow feature publish FEATURENAME

Get a feature published by another user from remote repository:

git flow feature pull origin FEATURENAME

Releases

Start a Release

Create release branch from develop:
git flow release start RELEASENAME
Publish release branch:
git flow release publish RELEASENAME
Create a local tracking branch for a remote release:
git flow release track RELEASENAME

Finish a Release

Merge release branch into master, tag it, merge back into develop, and remove the release branch:

git flow release finish RELEASENAME
git push --tags

Hotfixes

Start a Hotfix

Create hotfix branch from master:
git flow hotfix start VERSIONNAME
Create hotfix branch from some other commit:
git flow hotfix start VERSIONNAME BASENAME

Finish a Hotfix

Merge hotfix back into develop and master, and tag:

git flow hotfix finish VERSIONNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment