jesseduffield / jesseduffield/lazygit

Allow arguments config for `git flow finish` commands

Open
#5,296 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

### Is your feature request related to a problem? Please describe.
When using git flow, finishing a branch sometimes requires passing extra arguments like `--keepremote` to prevent the remote branch from being deleted (the merge request is being marked as closed, not merged). Currently, lazygit's git flow finish command doesn't support passing additional arguments, so users must exit lazygit and run the command manually in the terminal.

### Describe the solution you'd like
Add a configurable gitFlowFinishArgs option under git in the user config (config.yml) that accepts a list of extra arguments to append to git flow finish . For example:
```
git:
gitFlowFinishArgs:
- "--keepremote"
```
When the list is empty (the default), git flow finish behaves exactly as it does today with no extra arguments.

### Describe alternatives you've considered
- Hardcoding `--keepremote` into the finish command, but this forces the flag on all users.
- Using a lazygit custom command keybinding to run git flow finish manually, but this loses the branch-type detection logic and menu integration that lazygit provides.

### Additional context
This is useful for teams that use shared remote branches and want to keep them after finishing a git flow feature/release/hotfix. The implementation reads from the existing user config system and passes the configured args to the git flow finish command via the Arg() builder, so it's a minimal, non-breaking change.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.