-
Notifications
You must be signed in to change notification settings - Fork 0
Reference: Configuration
The LBEM Edition supports a .gitflow configuration file in the repository root. This file is automatically loaded during git flow init and allows teams to share git-flow settings.
Export your current configuration:
git flow config exportOr create manually in your repository root:
[branch]
master = main
develop = develop
[prefix]
feature = feature/
bugfix = bugfix/
release = release/
hotfix = hotfix/
support = support/
versiontag = v
[finish]
mode = propose
[sync]
strategy = rebase
[propose]
open = true| Section | Key | Description |
|---|---|---|
[branch] |
master |
Production branch name |
[branch] |
develop |
Development branch name |
[prefix] |
feature, bugfix, release, hotfix, support
|
Branch prefixes |
[prefix] |
versiontag |
Version tag prefix |
[finish] |
mode |
Finish behavior: classic, propose, or ask
|
[sync] |
strategy |
Sync strategy: rebase or merge
|
[propose] |
open |
Auto-open browser: true or false
|
A remote repo different from .origin. can be specified in the config file:
$ git config gitflow.origin myorigin
With git you can set environment variables to change the default behavior of git. You can set these environment variables just for git-flow.
These environment variables can be set in the file .gitflow_export in your
home directory.
Example of a .gitflow_export file:
export GIT_MERGE_AUTOEDIT=no
- Starting a hotfix, support, or release branch with a dirty tree.
By default you can not start one when your working tree is dirty. You can change this behavior by setting the following configuration.
git config --bool --set gitflow.allowdirty
This can be set like any other git configuration, global, system, or local.
The configuration variables are named as follows:
gitflow.<command>.<subcommand>.<flags>
All variables should be in lower caps.
If the variable is a boolean the following values are valid, the case does not matter:
- Y
- YES
- T
- TRUE
- N
- NO
- F
- FALSE
If the variable represents a string surround the value with double quotes.
This is an overview per command of configuration variables you can set. The list
is in the form variable - flag - valid value
For reading improvement the prefix gitflow. is not shown here but should
be used when you set the variable.
bugfix.start.fetch - fetch - boolean
bugfix.finish.fetch - fetch - boolean
bugfix.finish.rebase - rebase - boolean
bugfix.finish.preserve-merges - preserve-merges - boolean
bugfix.finish.push - push - boolean
bugfix.finish.keep - keep - boolean
bugfix.finish.keepremote - keepremote - boolean
bugfix.finish.keeplocal - keeplocal - boolean
bugfix.finish.force-delete - force_delete - boolean
bugfix.finish.squash - squash - boolean
bugfix.finish.squash-info - squash-info - boolean
bugfix.finish.no-ff - no-ff - boolean
bugfix.rebase.interactive - interactive - boolean
bugfix.rebase.preserve-merges - preserve-merges - boolean
bugfix.delete.force - force - boolean
bugfix.delete.remote - remote - boolean
bugfix.propose.draft - draft - boolean (LBEM Edition)
bugfix.propose.assignee - assignee - string (LBEM Edition)
bugfix.propose.reviewer - reviewer - string (LBEM Edition)
bugfix.propose.labels - label - string (LBEM Edition)
bugfix.propose.autolabel - autolabel - boolean (LBEM Edition)
feature.start.fetch - fetch - boolean
feature.finish.fetch - fetch - boolean
feature.finish.rebase - rebase - boolean
feature.finish.preserve-merges - preserve-merges - boolean
feature.finish.push - push - boolean
feature.finish.keep - keep - boolean
feature.finish.keepremote - keepremote - boolean
feature.finish.keeplocal - keeplocal - boolean
feature.finish.force-delete - force_delete - boolean
feature.finish.squash - squash - boolean
feature.finish.squash-info - squash-info - boolean
feature.finish.no-ff - no-ff - boolean
feature.rebase.interactive - interactive - boolean
feature.rebase.preserve-merges - preserve-merges - boolean
feature.delete.force - force - boolean
feature.delete.remote - remote - boolean
feature.propose.draft - draft - boolean (LBEM Edition)
feature.propose.assignee - assignee - string (LBEM Edition)
feature.propose.reviewer - reviewer - string (LBEM Edition)
feature.propose.labels - label - string (LBEM Edition)
feature.propose.autolabel - autolabel - boolean (LBEM Edition)
hotfix.start.fetch - fetch - boolean
hotfix.finish.fetch - fetch - boolean
hotfix.finish.sign - sign - boolean
hotfix.finish.push - push - boolean
hotfix.finish.keep - keep - boolean
hotfix.finish.keepremote - keepremote - boolean
hotfix.finish.keeplocal - keeplocal - boolean
hotfix.finish.force-delete - force-delete - boolean
hotfix.finish.notag - notag - boolean
hotfix.finish.nobackmerge - nobackmerge - boolean
hotfix.finish.signingkey - signingkey - string
hotfix.finish.message - message - string
hotfix.finish.messagefile - messagefile - string
hotfix.finish.create-release - create-release - boolean (LBEM Edition)
hotfix.rebase.interactive - interactive - boolean
hotfix.rebase.preserve-merges - preserve-merges - boolean
hotfix.delete.force - force - boolean
init.defaults - defaults - boolean
sync.prune - prune - boolean
release.start.fetch - fetch - boolean
release.finish.fetch - fetch - boolean
release.finish.sign - sign - boolean
release.finish.push - push - boolean
release.finish.keep - keep - boolean
release.finish.keepremote - keepremote - boolean
release.finish.keeplocal - keeplocal - boolean
release.finish.force-delete - force-delete - boolean
release.finish.notag - notag - boolean
release.finish.nobackmerge - nobackmerge - boolean
release.finish.squash - squash - boolean
release.finish.squash-info - squash-info - boolean
release.finish.signingkey - signingkey - string
release.finish.message - message - string
release.finish.messagefile - messagefile - string
release.finish.create-release - create-release - boolean (LBEM Edition)
release.branch.fetch - fetch - boolean
release.branch.sign - sign - boolean
release.branch.push - push - boolean
release.branch.notag - notag - boolean
release.branch.squash - squash - boolean
release.branch.squash-info - squash-info - boolean
release.branch.signingkey - signingkey - string
release.branch.message - message - string
release.branch.messagefile - messagefile - string
release.rebase.interactive - interactive - boolean
release.rebase.preserve-merges - preserve-merges - boolean
release.delete.fetch - fetch - boolean
release.delete.remote - remote - boolean
support.start.fetch - fetch - boolean
support.rebase.interactive - interactive - boolean
support.rebase.preserve-merges - preserve-merges - boolean
You can set these variables using the git config command
git config gitflow.release.finish.fetch yes
gitflow follows the same pattern for reading the options as git config.
You can use the options --system, --global, --local to write to that
location and gitflow will behave similar in reading the configuration as git.
The LBEM Edition adds the following configuration variables:
Controls how git flow feature finish and git flow bugfix finish behave.
git flow config set finishmode <mode>| Value | Description |
|---|---|
classic |
Traditional merge into develop (default) |
propose |
Create a pull request instead of merging |
ask |
Prompt each time: classic, propose, or abort |
Controls how git flow feature sync and git flow bugfix sync update branches.
git flow config set syncstrategy <strategy>| Value | Description |
|---|---|
rebase |
Rebase feature/bugfix branch on base branch (default) |
merge |
Merge base branch into feature/bugfix branch |
Controls whether sync automatically prunes stale local branches.
git config gitflow.sync.prune trueWhen enabled, git flow feature sync and git flow bugfix sync will prompt to delete local branches whose remote tracking branches have been deleted (e.g., branches merged via GitHub PR).
Safety: Branches with unpushed local commits are never auto-deleted.
Controls whether the browser opens automatically when using propose.
git flow config set proposeopen <boolean>| Value | Description |
|---|---|
true |
Auto-open browser for PR URL (default) |
false |
Only print PR URL, don't open browser |
Controls whether PRs are created as drafts by default.
git config gitflow.feature.propose.draft true
git config gitflow.bugfix.propose.draft trueDefault assignee(s) for PRs created with propose.
git config gitflow.feature.propose.assignee "username"
git config gitflow.bugfix.propose.assignee "user1,user2"Default reviewer(s) for PRs created with propose.
git config gitflow.feature.propose.reviewer "reviewer1"
git config gitflow.bugfix.propose.reviewer "reviewer1,reviewer2"Default label(s) for PRs created with propose.
git config gitflow.feature.propose.labels "enhancement"
git config gitflow.bugfix.propose.labels "bug,fix"Automatically add branch type as a label (e.g., "feature" or "bugfix").
git config gitflow.feature.propose.autolabel true
git config gitflow.bugfix.propose.autolabel trueControls whether releases are created automatically on release/hotfix finish.
git config gitflow.release.finish.create-release true
git config gitflow.hotfix.finish.create-release trueWhen enabled, git flow release finish and git flow hotfix finish will create a GitHub/GitLab release using the CLI tools (gh or glab).
# Set up for PR-based workflow
git flow config set finishmode propose
git flow config set syncstrategy rebase
git flow config set proposeopen true
# Configure propose defaults
git config gitflow.feature.propose.draft true
git config gitflow.feature.propose.reviewer "lead-dev"
git config gitflow.feature.propose.autolabel true
# Enable sync pruning
git config gitflow.sync.prune true
# Enable GitHub releases
git config gitflow.release.finish.create-release true
git config gitflow.hotfix.finish.create-release true
# Export to share with team
git flow config export
git add .gitflow
git commit -m "Configure git-flow for PR workflow"