| name | sync-branch-to-develop |
| description | Use when finishing work on a feature branch and wanting to promote it to develop (or another integration branch) while staying on the original branch. Handles commit, push, merge, push develop, and return. |
Sync branch to develop
Overview
Promote the current branch to the develop integration branch and return, so the user keeps working where they were. The sequence: commit any pending work, push the current branch, fast-forward-update develop, merge the branch into develop, push develop, check out the original branch.
Users end where they started. Never leave them on develop.
When to use
- User says: "sync to develop", "push and merge to develop", "promote this branch to staging", "land this on develop", or equivalent.
- A feature branch is ready to land on the integration branch while work continues.
When NOT to use
- Current branch IS
develop, main, or another protected trunk → refuse, explain why.
- Target is not
develop → confirm the target branch name with the user before proceeding.
- User wants to merge via PR, not directly → skip this skill and open a PR instead.
Workflow
Before step 1: capture the starting branch with git rev-parse --abbrev-ref HEAD. You return here at the end no matter what — including on failure.
1. Commit pending work (skip if clean)
- Run
git status --porcelain. Empty → skip this step.
- Read all pending changes:
git status + git diff (staged + unstaged).
- Look at recent commit history to match the repo's style:
git log --oneline -10.
- Draft the commit message following the rules in "Writing the commit message" below.