Skip to content

Instantly share code, notes, and snippets.

@codemedic
Forked from JamesMGreene/gitflow-breakdown.md
Last active August 6, 2025 23:25
Show Gist options
  • Save codemedic/6582a7a080f51128fd0e47e8ce63258e to your computer and use it in GitHub Desktop.
Save codemedic/6582a7a080f51128fd0e47e8ce63258e to your computer and use it in GitHub Desktop.
Raw git commands corresponding to the most common git-flow commands. Based on git-flow AVH edition.

Initialize

gitflow git
git flow init git init
git commit --allow-empty -m "Initial commit"
git checkout -b develop master

Connect to the remote repository

gitflow git
N/A git remote add origin [email protected]:MYACCOUNT/MYREPO

Features

Create a feature branch

gitflow git
git flow feature start MYFEATURE git checkout -b feature/MYFEATURE develop

Share a feature branch

gitflow git
git flow feature publish MYFEATURE git checkout feature/MYFEATURE
git push -u origin feature/MYFEATURE

Get latest for a feature branch

gitflow git
git flow feature pull origin MYFEATURE git checkout feature/MYFEATURE
git pull --rebase origin feature/MYFEATURE

Finalize a feature branch

gitflow git
git flow feature finish MYFEATURE git checkout develop
git merge --no-ff feature/MYFEATURE
git branch -d feature/MYFEATURE

Push the merged feature branch

gitflow git
N/A git push origin develop
git push origin --delete feature/MYFEATURE (if pushed)

Releases

Create a release branch

gitflow git
git flow release start 1.2.0 git checkout -b release/1.2.0 develop

Share a release branch

gitflow git
git flow release publish 1.2.0 git push -u origin release/1.2.0

Get latest for a release branch

gitflow git
N/A git checkout release/1.2.0
git pull --rebase origin release/1.2.0

Finalize a release branch

gitflow git
git flow release finish 1.2.0 git checkout master
git merge --no-ff release/1.2.0
git tag -a 1.2.0
git checkout develop
git merge --no-ff 1.2.0
git branch -d release/1.2.0

Push the finalized release

gitflow git
N/A git push origin master
git push origin develop
git push origin --tags
git push origin --delete release/1.2.0 (if pushed)

Hotfixes

Create a hotfix branch

From master

gitflow git
git flow hotfix start 1.2.1 git checkout -b hotfix/1.2.1 master

From a tag

gitflow git
git flow hotfix start 1.2.1 1.2.0 git checkout -b hotfix/1.2.1 1.2.0

Finalize a hotfix branch

gitflow git
git flow hotfix finish 1.2.1 git checkout master
git merge --no-ff hotfix/1.2.1
git tag -a 1.2.1
git checkout develop
git merge --no-ff 1.2.1
git branch -d hotfix/1.2.1

Push the merged hotfix

gitflow git
N/A git push origin master
git push origin develop
git push origin --tags
git push origin --delete hotfix/1.2.1 (if pushed)

References

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