micro
1.0.0
1.0.0
  • Micro Starter Kit
  • Features
  • Getting Started
    • Why
    • Prerequisites
    • Installation
    • Makefile
  • Concepts
    • Introduction
    • Configuration
    • State
    • Select
  • Advanced
    • Dependency Injection
    • Logging
    • Error Handling
    • Life-cycle
    • Git Flow
    • Git Ops
    • mTLS
    • Release
    • Release Process
    • Pub Sub
    • Troubleshooting
  • Modules
    • Commands
      • Demo
    • Services
      • Account
      • Emailer
      • Greeter
      • Recorder
  • DevOps
    • Docker
    • KinD
    • Istio
  • Testing
    • Intro
    • Mock
    • Bloom RPC
  • Recipes
    • Authentication
    • Caching
    • Health Checks
    • Performance Testing
    • Dynamic Plugins
    • Immutability Helpers
    • Style Guide
    • Unit Testing
  • Community
    • Resources
    • Contributors
    • Contributing
  • Change Log
  • FAQ
Powered by GitBook
On this page
  • Branches
  • Setup
  • FAQ
  • Versioning
  • Changelog
  • Reference

Was this helpful?

  1. Advanced

Git Flow

PreviousLife-cycleNextGit Ops

Last updated 5 years ago

Was this helpful?

we are using for branch management

Branches

  • Production branch: master

  • Develop branch: develop

  • Feature prefix: feature/

  • Release prefix: release/

  • Hotfix prefix: hotfix/

Setup

# install git-flow for mac
brew install git-flow-avh
# Start using git-flow by initializing it inside an existing git repository
git flow init [-d] # The -d flag will accept all defaults.
# Start a new feature
git flow feature start grpc
# Finish up a feature
git flow feature finish grpc
# Publish a feature
git flow feature publish grpc
# Get a feature published by another user.
git flow feature pull origin grpc
## Make a release
# Start a release
git flow release start '0.1.0'
# It's wise to publish the release branch after creating it to allow release commits by other developers
git flow release publish '0.1.0'
## Finish up a release,
# Merges the release branch back into 'master'
# Tags the release with its name
# Back-merges the release into 'develop'
# Removes the release branch
git flow release finish '0.1.0'
# Don't forget to push your tags with
git push origin --tags

FAQ

  • How to keep your feature branch in sync with your develop branch?

    While using GitFlow, it is a good practice to keep your feature branch in sync with the develop branch to make merging easy.

    I do the following to keep my feature branch in sync with develop.

    git checkout develop    #if you don't have it already
    git checkout feature/x  #if you don't have it already
    git pull --all
    git merge develop
  • Ever annoyed by the long list of local Git branches that are no longer relevant?

    Solution:

    git remote prune origin

    That removes all local branches that have been deleted from remote (typically GitHub) Add --dry-run to merely see a list first to confirm.

Versioning

Changelog

git-chglog -c .github/chglog/config.yml -o CHANGELOG.md
git-chglog -c .github/chglog/config.yml -o CHANGELOG.md --next-tag 2.0.0

Reference

generate changelog using

GitFlow
git-chglog
https://nvie.com/posts/a-successful-git-branching-model/
https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow
https://danielkummer.github.io/git-flow-cheatsheet/