update

Fast-forwards a local repository's main branch to a remote's main after confirmation.

6|1|Updated Jul 11, 2026
One-click install
npx skills add https://github.com/jl-cmd/claude-dev-env --skill update-jl-cmd
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: update
Source: https://github.com/jl-cmd/claude-dev-env/tree/main/skill-archive/update
Command: npx skills add https://github.com/jl-cmd/claude-dev-env --skill update-jl-cmd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Keeping a local repository's main branch synchronized with its remote source of truth is a repetitive git task that risks mistakes like forcing over diverged history, merging into a dirty working tree, or pulling from the wrong remote. This Skill performs the sync as a strictly verified fast-forward with explicit confirmation of the repo path and source remote before any write. ## Core Features & Use Cases - Confirmed fast-forward only: Fetches the chosen remote, verifies local main is an ancestor of the remote's main, and advances the ref without forcing, merging, or rewriting other branches. - Checkout-aware handling: Uses merge --ff-only when on main, fetch remote main:main when off main, and offers an approved switch to main so new commits reach the files on disk. - Safety refusals: Stops with exact messages when the path is not a git repo, the remote has no main, or main has diverged, and never stashes, resets, or discards local work. - Use Case: You have a fork where origin points to your fork and upstream points to the canonical repo. Run the skill, confirm the path and upstream remote, and it fast-forwards local main to upstream/main while reporting exactly what changed and what your checkout actually runs. ## Quick Start Ask the AI to update main in your repository by saying "/update /path/to/repo" or "sync main from origin", then confirm the path and remote when prompted.

Frequently Asked Questions about update

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fast-forward my local main branch to match origin?▼

Fetch the remote first, verify local main is an ancestor of origin/main with git merge-base --is-ancestor, then run git merge --ff-only origin/main while on main. This skill automates that sequence after confirming the repo path and remote.

How to update main without checking it out or switching branches?▼

Use git fetch <remote> main:main, which advances the local main ref to the remote's main without touching your working tree or current branch. It is fast-forward-only and refuses if main is checked out in any worktree.

Why does git fetch refuse with 'refusing to fetch into branch checked out'?▼

Git blocks fetching into a branch that is currently checked out in any worktree of the repo. Find the worktree with git worktree list, then either run the fast-forward from that path or use merge --ff-only there instead.

What happens when local main has diverged from the remote main?▼

A fast-forward is impossible when main has commits the remote lacks, so the skill stops and reports the ahead/behind counts. Divergence must be reconciled with a rebase or manual merge; the skill never forces the ref.

Can I sync main from a remote other than origin, like upstream?▼

Yes. The skill lists all remotes with their URLs and asks you to confirm which one is the source of truth, since origin is not always canonical. This is common in fork workflows where upstream holds the authoritative main.

Does fast-forwarding main change the files in my working directory?▼

Only if main is the checked-out branch. When another branch is checked out, the fast-forward moves the ref only; the skill reports this gap and, after safety checks, offers an approved checkout of main to land the commits on disk.