| name | commit-push-task |
| description | Commit changes on the current branch, get them onto the task branch, and push the task branch |
| user-invocable | true |
Commit any pending changes, get them onto the task branch, then push the task branch to origin. Never push a worktree branch.
The session's startup system reminder identifies:
- "Task branch: " — the branch to push
- "Worktree branch: " — your own branch, present only when you have one
If the "Task branch" line is missing, abort and ask the user for the task branch name.
Two shapes, decided by that reminder:
- No "Worktree branch" line — you are the task's main session (or run without a worktree) and are already on the task branch. Do steps 1, 2, 5 and 6 only.
- "Worktree branch" line present — you are on your own branch and must merge into the task branch (all steps). The task branch is checked out in the main session's worktree, so never check it out here.
Steps
-
Confirm the current branch matches the reminder — the worktree branch if you have one, otherwise the task branch:
git rev-parse --abbrev-ref HEAD
If it does not match, abort and report the mismatch.
-
Check for uncommitted changes:
git status --porcelain
If there are changes, stage and commit them on the current branch:
git add -A
git commit -m "<short message describing the change>"
Choose a concise, conventional commit message based on the diff. Do NOT include any "Generated by" / co-author trailers.
-
Find where the task branch lives:
git worktree list --porcelain
The entry with branch refs/heads/<task-branch> gives that worktree's path; the first entry is the main repository.
-
Get your commits onto the task branch:
If this fails, abort and report. Do NOT force, rebase, or merge non-ff without explicit user confirmation. The two common causes:
- the task branch has commits you don't have (diverged) — the user can merge your session from the TUI (
m) instead;
- the task branch's worktree has uncommitted changes blocking the merge — that is the main session's work in progress, so leave it alone.
-
Push only the task branch:
git -C <main-repo-path> push origin <task-branch>
Do NOT push a worktree branch. Do NOT use --force or --force-with-lease unless the user explicitly asks.
-
Report a one-line summary: commit SHA (if a new commit was made), task branch updated to that SHA, and push result.
Edge cases
- Nothing to commit and the task branch already at your HEAD: skip commit and merge, still attempt push (a no-op, or "Everything up-to-date").
- Pre-commit hook fails: do NOT use
--no-verify. Report the failure and stop.