Skip to content

Instantly share code, notes, and snippets.

@mjuenema
Last active January 22, 2019 14:43
Show Gist options
  • Save mjuenema/91815dc99abd015967e763a5528b9bbd to your computer and use it in GitHub Desktop.
Save mjuenema/91815dc99abd015967e763a5528b9bbd to your computer and use it in GitHub Desktop.
Git Flow Quick Reference

Git Flow Quick Reference

Init

$ git flow init -d

Feature

$ git flow feature start MY_NEW_FEATURE
...
$ git flow feature publish MY_NEW_FEATURE     # optional
...
$ git push origin feature/MY_NEW_FEATURE
...
$ git flow feature finish -F -p -m 'Release 0.0.1' 0.0.1
...
$ git push origin :feature/MY_NEW_FEATURE

Release

Also see the Python packages section at the bottom.

$ git flow release start 0.1.0
$ git flow release publish 0.1.0              # prevents an error message later
...
  • Update version strings.
  • Run tests.
  • Update changelog.
  • Install locally.
...
$ git push origin release/0.1.0
$ git flow release finish -F -p  -m 'Release 0.1.0' 0.1.0

Hotfix

git flow hotfix start 0.1.1
git flow hotfix publish 0.1.1
  • Update version strings.
  • Run tests.
  • Update changelog.
  • Install locally.
git push origin hotfix/0.1.1
git flow hotfix finish -F -p -m 'Release 0.1.1' 0.1.1
git push origin :hotfix/0.1.1

Python packages

Perform the following steps to update the version number and possibly the classifiers section of a Python package and upload the latest version to PyPi. Check ~/.pypirc for settings.

$ pip install --upgrade twine wheel docutils pygments
$ vim setup.py                    # Update version and classifiers
$ vim package/__init__.py         # Update version

Verify that the README will render on PyPi. Fix any errors as PyPi is very picky.

rst2html README.rst >/dev/null
$ python3 setup.py clean
$ python3 setup.py sdist
$ python3 setup.py bdist_wheel --universal
$ twine upload dist/package-0.1.0*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment