Repository navigation
chore(skills): fast-forward main after the merge lands - #75
Merged
Merged
Conversation
Landing a pull request used to leave this machine behind it: the squash existed on GitHub while local main still pointed at the commit before, so the next piece of work started from stale ground. Closing that needs one detail git will not let you guess - main is checked out in the primary worktree, which is why it moves there through git -C rather than from the session's own worktree, and why the move is --ff-only. The rest of the skill drops to the commands plus the few traps worth writing down. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A session that lands a pull request from a worktree leaves this machine a step behind GitHub: the squash is up there and local
mainstill points at the commit before it, so the next branch is cut from stale ground. Closing that gap carries one detail git will not let you guess —mainis checked out in the primary worktree, sogit fetch origin main:mainrefuses and the fast-forward has to run there throughgit -C. Themerge-and-clean-upskill now holds the whole loop: merge, sync, clean up.What changes
.agents/skills/merge-and-clean-up/SKILL.md— aSync mainstep between landing and the clean-up:fetch --prune, thengit -C <the worktree tagged [main]> merge --ff-only origin/main. A refusal ends the sync and goes in the report; the merge already happened.headRefNameread off the firstgh pr viewso the branch name has a source.Test plan
pnpm format— passfetch origin main:mainrefuses withrefusing to fetch into branch 'refs/heads/main' checked out at ...;merge --ff-onlyfast-forwards over an unrelated dirty file, and refuses without writing on a file it would touch (Your local changes ... would be overwritten) and on a divergedmain(Not possible to fast-forward, aborting)Risk
Documentation for an agent, with no code path behind it. A wrong line makes a session do the wrong thing by hand; the two writes it adds are
--ff-only, which refuses rather than inventing a merge commit or touching another session's uncommitted work, and nothing here removes a worktree.🤖 Generated with Claude Code