Skip to content

Instantly share code, notes, and snippets.

@LunaCodeGirl
Last active December 23, 2015 02:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LunaCodeGirl/6569076 to your computer and use it in GitHub Desktop.
Save LunaCodeGirl/6569076 to your computer and use it in GitHub Desktop.
git-flow cheat sheet. A paradigm for git management that helps manage branches and types of branches.
#May branch off from: develop
#Must merge back into: develop
#Branch naming convention: anything except master, develop, release-*, or hotfix-*
#Create Feature Branch
git checkout -b myfeature develop
#Incorporate finished feature branch into develop
git checkout develop
#Switched to branch 'develop'
git merge --no-ff myfeature
git branch -d myfeature
#Deleted branch myfeature (was 05e9557).
git push origin develop
#May branch off from: master
#Must merge back into: develop and master
#Branch naming convention: hotfix-*
#creating release branch
git checkout -b hotfix-1.2.1 master
#finish release branch and add to master and dev branches
git checkout master
git merge --no-ff hotfix-1.2.1
git tag -a 1.2.1
git checkout develop
git merge --no-ff hotfix-1.2.1
#deleting branch
git branch -d hotfix-1.2.1
#May branch off from: develop
#Must merge back into: develop and master
#Branch naming convention: release-*
#creating release branch
git checkout -b release-1.2 develop
#finish release branch and add to master and dev branches
git checkout master
git merge --no-ff release-1.2
git tag -a 1.2
git checkout develop
git merge --no-ff release-1.2
#deleting branch
git branch -d release-1.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment