pull
Bring the current git checkout up to date with its upstream — without losing local work or stomping a half-finished rebase.
When to use
Trigger this skill when the user asks to:
- "pull", "/pull"
- "rebase against main/origin"
- "update this checkout"
- "sync with upstream"
If you're not in a git repo, say so and stop.
What to do
Run these checks in order. Stop and report at the first failure — never push through.
- Confirm git repo.
git rev-parse --git-dir— if it fails, say "not a git repo" and stop. - Confirm clean-enough working tree.
git status --porcelain— if any output, decide:- Untracked files only: fine, proceed.
- Modified/staged files: tell the user, then proceed with
--autostash. - Unresolved merge/rebase markers (
<<<<<<<): stop and tell the user to resolve first.
- Check current branch.
git symbolic-ref --short HEAD— if detached HEAD, stop and say so. - Check upstream is set.
git rev-parse --abbrev-ref --symbolic-full-name @{u}— if missing, ask the user which remote/branch to pull from (don't guess). - Pull with rebase + autostash:
git pull --rebase --autostash. - Summarize. Report: starting commit → ending commit (short SHAs), number of commits applied, any auto-stash that was reapplied.
What not to do
- Don't
git pullwithout--rebase— the user wants linear history. - Don't
git reset --hardto "recover" from a failed rebase. Stop and tell the user. - Don't push.
- Don't switch branches.
- Don't run
git gcor any other "cleanup."
Output format
Keep it tight — 3 lines max on success:
pulled <N> commit(s) from <upstream>
<oldsha>..<newsha> on <branch>
(autostash: <reapplied|n/a>)
On failure, one line of cause + one suggested next step.