$ brew install git-flow
git flow init
Typically exist in developers repos only
This creates a new branch based on develop
and switches to it
git flow feature start MYFEATURE
Merged MYFEATURE into develop
, removes the feature branch, and switches back to develop
:
git flow feature finish MYFEATURE
Push a feature branch to remote repository:
git flow feature publish MYFEATURE
Get a feature published by another user from remote repository:
git flow feature pull origin MYFEATURE
-
Delete a Git branch locally and remotely:
- There are 3 different branches to delete:
- The local branch
X
- The remote origin branch
X
- The local remote-tracking branch
origin/X
that tracks the remote branchX
- The local branch
- There are 3 different branches to delete:
git branch -D bugfix // delete local branch
git push origin --delete BRANCH_NAME // delete the remote and local remote-tracking branch
Use merge or rebase, generally it's better to use merge
git checkout feature
git merge develop
Create release branch from develop
:
git flow release start RELEASE
Publish release branch:
git flow release publish RELEASE
Create a local tracking branch for a remote release:
git flow release track RELEASE
Merge release branch into master
, tags the release with its name, merge back into develop
, and remove the release branch:
git flow release finish RELEASE
git push --tags
Create hotfix branch from master
:
git flow hotfix start VERSION [BASENAME]
Merge hotfix back into develop and master, and tag:
git flow hotfix finish VERSION
Push the develop
branch to remote, use the regular git command
git push origin develop
- git-flow Cheatsheet: http://danielkummer.github.io/git-flow-cheatsheet/
- Vincent Driessen's branching model: http://nvie.com/posts/a-successful-git-branching-model/