Add /pull skill and remove auto-push from /sync-branch

- New /pull command: pulls main and updates submodules locally
- sync-branch: never pushes automatically, asks user first
- No pushing to submodules; all changes land via PRs
This commit is contained in:
Lawrence Chen 2026-02-19 17:28:49 -08:00
parent 9a8e5f9d13
commit 41639d226c
2 changed files with 22 additions and 5 deletions

16
.claude/commands/pull.md Normal file
View file

@ -0,0 +1,16 @@
# Pull
Pull latest main and update all submodules to their latest remote main. No commits, no pushes.
## Steps
1. `git pull origin main`
2. For each submodule (ghostty, homebrew-cmux, vendor/bonsplit):
- `cd <submodule>`
- `git fetch origin`
- Check if behind: `git rev-list HEAD..origin/main --count`
- If behind, merge: `git merge origin/main --no-edit`
- Do NOT push. We only land submodule changes via PRs.
- Go back to repo root
3. `git submodule update --init --recursive`
4. Report: current commit, which submodules were updated and by how many commits

View file

@ -1,6 +1,8 @@
# Sync Branch # Sync Branch
Get the current branch ready: update all submodules to their latest remote main, merge from main, and push. Get the current branch ready: update all submodules to their latest remote main, merge from main, and rebase.
**Important: Never push automatically. Always ask the user before any push.**
## Steps ## Steps
@ -10,21 +12,20 @@ Get the current branch ready: update all submodules to their latest remote main,
- `git fetch origin` - `git fetch origin`
- Check if behind: `git rev-list HEAD..origin/main --count` - Check if behind: `git rev-list HEAD..origin/main --count`
- If behind, merge: `git merge origin/main --no-edit` - If behind, merge: `git merge origin/main --no-edit`
- For ghostty specifically, push the merge to the fork: `git push origin HEAD:main` - Do NOT push submodules. We only land submodule changes via PRs.
- Verify with: `git merge-base --is-ancestor HEAD origin/main`
- Go back to repo root - Go back to repo root
2. **Commit submodule updates on main** 2. **Commit submodule updates on main**
- `git checkout main && git pull origin main` - `git checkout main && git pull origin main`
- Check if any submodules changed: `git diff --name-only` (look for submodule paths) - Check if any submodules changed: `git diff --name-only` (look for submodule paths)
- If changed, stage and commit: `git add ghostty homebrew-cmux vendor/bonsplit && git commit -m "Update submodules: <brief description>"` - If changed, stage and commit: `git add ghostty homebrew-cmux vendor/bonsplit && git commit -m "Update submodules: <brief description>"`
- Push main: `git push origin main` - **Do not push.** Ask the user if they want to push.
3. **Rebase current branch on main** 3. **Rebase current branch on main**
- `git checkout <original-branch>` - `git checkout <original-branch>`
- `git rebase main` - `git rebase main`
- If conflicts, resolve them and continue - If conflicts, resolve them and continue
- Force push if branch was already pushed: `git push --force-with-lease origin <branch>` - **Do not push.** Ask the user if they want to force-push the rebased branch.
4. **Report status** 4. **Report status**
- Show what submodules were updated and by how many commits - Show what submodules were updated and by how many commits