Currently, finish only checks whether the topic branch is in sync with its remote tracking branch. It does not check whether the parent branch (merge target) is up to date. This matches AVH behavior where the parent branch sync status is also verified before proceeding.
Problem
If the parent branch (e.g., develop or main) is behind its remote, the finish merge will succeed locally but the result will be based on a stale parent. The user may then need to reconcile differences when pushing, or worse, overwrite remote changes.
Proposed Behavior
When fetch is enabled and the parent branch has a remote tracking branch:
- Fetch the parent branch (already done today)
- Compare local parent with its remote tracking branch
- If behind or diverged, abort with a clear message telling the user to update the parent branch first
- If ahead, proceed (local has more — that's fine)
--force skips this check
Reference
git-flow-avh performs this check. This brings git-flow-next to parity for users who rely on remote-aware workflows.
Currently,
finishonly checks whether the topic branch is in sync with its remote tracking branch. It does not check whether the parent branch (merge target) is up to date. This matches AVH behavior where the parent branch sync status is also verified before proceeding.Problem
If the parent branch (e.g.,
developormain) is behind its remote, the finish merge will succeed locally but the result will be based on a stale parent. The user may then need to reconcile differences when pushing, or worse, overwrite remote changes.Proposed Behavior
When fetch is enabled and the parent branch has a remote tracking branch:
--forceskips this checkReference
git-flow-avh performs this check. This brings git-flow-next to parity for users who rely on remote-aware workflows.