| name | sync-branches |
| description | Sync commits to both main and v0/rohangupta-dec27c78 branches. Use after committing changes, when pushing code, or when asked to sync branches. Ensures both branches stay in lockstep. |
| disable-model-invocation | true |
| allowed-tools | Bash(git *) |
Sync Both Branches
After committing changes, sync them to both main and v0/rohangupta-dec27c78 branches. Both branches MUST always stay in sync.
Steps
-
Confirm current state
- Run
git status to ensure the working tree is clean
- Run
git log --oneline -3 to identify the commit(s) to sync
- Note the current branch
-
If on main:
git checkout v0/rohangupta-dec27c78
git cherry-pick <commit-hash>
git checkout main
-
If on v0/rohangupta-dec27c78:
git checkout main
git cherry-pick <commit-hash>
git checkout v0/rohangupta-dec27c78
-
Push both branches:
git push origin main
git push origin v0/rohangupta-dec27c78
-
Return to the original branch the user was on.
Rules
- NEVER force push
- NEVER push to only one branch — both must be updated
- If cherry-pick has conflicts, stop and ask the user for guidance
- If there are uncommitted changes, stop and ask the user to commit first
- Always verify both branches have the same HEAD commit after sync