Skip to content

Reference: git flow init

Konstantin edited this page Dec 15, 2025 · 5 revisions

Reference: git flow init

git flow init - Initialize the repository for git flow usage.

Description

Setup a git repository for git flow usage. Can also be used to start a git repository.

Synopsis

git flow init [-h] [-d] [-f]

Options

-h,--[no]help
show this help

--showcommands
Show git commands while executing them

-d,--[no]defaults
use default branch naming conventions

-f,--[no]force
force setting of gitflow branches, even if already configured

Use config file location
--local
use repository config file - Default

--global
use global config file

--system
use system config file

--file ...
use given config file


LBEM Edition Settings

When running git flow init, the LBEM Edition prompts for additional workflow settings:

Draft PRs by Default

Create draft PRs by default? (propose --draft) [no]

Sets whether git flow feature propose and git flow bugfix propose create draft pull requests by default.

Configuration: gitflow.feature.propose.draft and gitflow.bugfix.propose.draft

Create GitHub/GitLab Releases

Create GitHub/GitLab releases on finish? (release/hotfix finish --create-release) [no]

Sets whether git flow release finish and git flow hotfix finish automatically create GitHub/GitLab releases.

Configuration: gitflow.release.finish.create-release and gitflow.hotfix.finish.create-release

Sync Prune Behavior

Prune stale branches on sync? (sync --prune) [no]

Sets whether git flow feature sync and git flow bugfix sync automatically prune local branches whose remote tracking branches have been deleted (e.g., branches merged via GitHub PR).

Configuration: gitflow.sync.prune

Example Init Session

$ git flow init

Which branch should be used for production releases?
   - main
Branch name for production releases: [main] 

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/] 
Bugfix branches? [bugfix/] 
Release branches? [release/] 
Hotfix branches? [hotfix/] 
Support branches? [support/] 
Version tag prefix? [] v
Hooks and samples? [.git/hooks] 

LBEM Edition Settings:
Create draft PRs by default? (propose --draft) [no] yes
Create GitHub/GitLab releases on finish? (release/hotfix finish --create-release) [no] yes
Prune stale branches on sync? (sync --prune) [no] yes

Clone this wiki locally