- To have a local working copy of a remote git repository.
$ git flow init -d
With -d the default branch names are used.
$ git flow feature start <featurename> [1]
This creates a new branch based on develop
and switches to it.
Tip. To create a local tracking branch for a remote feature:
$ git flow feature track <featurename>
To develop a feature, just work as usual using the git commands like git add, git commit or, if the repository lives on Github, even through the Github Web GUI (selecting the proper feature branch).
$ git flow feature publish <featurename>
This pushes a feature branch to the remote repository.
This merges the feature into develop
, removes the feature branch, and switches to develop
:
$ git flow feature finish <featurename>
$ git push
If you published the feature on the remote, remove the remote branch by typing:
$ git push origin :feature/<featurename>
Create hotfix branch from master
:
$ git flow hotfix start <versionname>
Tip. To create hotfix branch from some other commit:
$ git flow hotfix start <versionname> <basename>
$ git flow hotfix finish <versionname>
$ git push --tags
This merges the hotfix back into develop
and master
, and tag it.
Create release branch from develop
:
$ git flow release start <releasename>
$ git flow release finish <releasename>
$ git push --tags
This merges the release branch into master
, tag it, merge back into develop
, and remove the release branch.
- git-flow Home: https://github.com/nvie/gitflow
- Detailed Cheatsheet: http://danielkummer.github.io/git-flow-cheatsheet/
- Command-line Arguments Reference: https://github.com/nvie/gitflow/wiki/Command-Line-Arguments
[1] As featurename it is suggested to use the issueid of the Github tracker system for the repository, for example https://github.com/Terradue/repository-name/issues.