Sauter Git Workflow : Initialize Git Flow - sauter-hq/git-guidelines GitHub Wiki
Prepare repository for git flow
-
Before you can initialze Git Flow for a freshly cloned repository, you have to check out the branch master (the initialization procedure of git flow needs a local copy of the branches master and develop)
-
SourceTree :
-
Command Line :
# Tell to create a local branch master following the remote branch master git checkout -b master origin/master
-
This will automatically make master the active one.
- Therefore, you should immediately switch back to branch develop by double clicking on it or if you don't have a gui type : "git checkout develop".
Stay on this branch to develop. Never stay on branch master to develop!
Initialize git flow
-
SourceTree : In SourceTree the active branch has a checkmark in the navigation bar. You can see the active branch also in the right lower corner of the application:
- Initialize Git Flow by clicking on Git Flow and select the following for branches (these are the defaults):
- Production branch : master
- Development branch : develop
- Feature branch prefix : feature/
- Release branch prefix : release/
- Hotfix branch prefix : hotfix/
-
Command Line : On the command line
git status
tells you on which branch you are currently on.- Initialize Git Flow by running
git flow init
That you shold let to the default as the output of git flow shown :
Which branch should be used for bringing forth production releases? - develop - master Branch name for production releases: [master] Which branch should be used for integration of the "next release"? - develop Branch name for "next release" development: [develop] How to name your supporting branch prefixes? Feature branches? [feature/] Release branches? [release/] Hotfix branches? [hotfix/] Support branches? [support/] Version tag prefix? []