name: git-fast-forward
path: .git
disable-model-invocation: true
description: "Fast-forward a Git target branch to the current branch and push it without creating a merge commit. Use for direct linear branch integration."
Git Fast-Forward
This operation advances a target only when the fetched target is an ancestor of the current commit.
Never force-push, bypass hooks autonomously, or discard local target work.
Procedure
Require a clean tree, an attached branch, and no merge, rebase, cherry-pick, or revert in progress.
Resolve the remote from configured upstream state, or the sole remote; ask when ambiguous.
Resolve the explicit target or the remote's symbolic default branch.
Fall back to an existing remote trunk, main, master, or develop branch without changing remote configuration.
Refuse when the current branch is the target; synchronize that branch instead.
Fetch the resolved remote with pruning and tags.
Verify the fetched remote target is an ancestor of the current commit.
Otherwise stop and require synchronization first.
If a local target branch exists, protect it:
stop if it contains commits absent from the fetched remote target;
stop if it is checked out in another worktree;
do not move it before the remote update.
Require explicit authorization to advance the target.
Run repository-required gates plus requested or obvious fast checks.
Stop when a required check fails.
Push the current commit to the target with a normal explicit refspec.
If rejected, fetch and repeat the ancestry check once before one retry.
If a hook fails, preserve its edits and stop with the failing command and evidence.
After a verified push, optionally fast-forward an unoccupied local target branch.
Never overwrite a divergent or locally advanced target.
Offer scoped deletion of the integrated source branch; never delete it automatically.
Report source, target, remote, old and new target commits, checks, push result, and local-target state.
---
name: git-fast-forward
path: .git
disable-model-invocation: true
description: "Fast-forward a Git target branch to the current branch and push it without creating a merge commit. Use for direct linear branch integration."
---
# Git Fast-Forward
This operation advances a target only when the fetched target is an ancestor of the current commit.
Never force-push, bypass hooks autonomously, or discard local target work.
## Procedure
1. Require a clean tree, an attached branch, and no merge, rebase, cherry-pick, or revert in progress.
2. Resolve the remote from configured upstream state, or the sole remote; ask when ambiguous.
3. Resolve the explicit target or the remote's symbolic default branch.
Fall back to an existing remote `trunk`, `main`, `master`, or `develop` branch without changing remote configuration.
4. Refuse when the current branch is the target; synchronize that branch instead.
5. Fetch the resolved remote with pruning and tags.
6. Verify the fetched remote target is an ancestor of the current commit.
Otherwise stop and require synchronization first.
7. If a local target branch exists, protect it:
- stop if it contains commits absent from the fetched remote target;
- stop if it is checked out in another worktree;
- do not move it before the remote update.
8. Require explicit authorization to advance the target.
9. Run repository-required gates plus requested or obvious fast checks.
Stop when a required check fails.
10. Push the current commit to the target with a normal explicit refspec.
If rejected, fetch and repeat the ancestry check once before one retry.
If a hook fails, preserve its edits and stop with the failing command and evidence.
11. After a verified push, optionally fast-forward an unoccupied local target branch.
Never overwrite a divergent or locally advanced target.
12. Offer scoped deletion of the integrated source branch; never delete it automatically.
13. Report source, target, remote, old and new target commits, checks, push result, and local-target state.