Two bundled fixes across the same nine skills, since both touch the same files. Issue #113: skill prose used rtk git and bare git inconsistently for the same operations, with no stated rule for which applied where. Executable instructed commands (a dispatch-table "Run" cell, a fenced code-block procedure, an imperative step) now consistently use rtk git; illustrative or referential mentions -- naming a flag's behavior, quoting a doc heading, warning against an anti-pattern -- stay bare git. Documented in the new plugins/git/README.md, scoped to this plugin only: gitea-* skills talk to the server over MCP tools and carry no git/rtk mentions at all. Also the git-plugin slice of #127: metadata.version added to the eight skills that lacked it. git-commits already had one and is untouched. Fixes: #113 Fixes: #127 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EeH8SCbcrCAQrtymkNuhKP
1.6 KiB
1.6 KiB
topic, source_keys
| topic | source_keys | ||
|---|---|---|---|
| fetch |
|
Fetching
Fetch with no refspec updates remote-tracking branches (refs/remotes/<name>/*) and leaves every local branch alone.
That safety comes from the default refspec, not from fetch itself. Give it an explicit one and it writes to local branches: verified on Git 2.39.5, git fetch origin main:probe fast-forwarded the local probe branch, and a + prefix force-updates the destination, discarding whatever commits it held. Treat any fetch carrying a <src>:<dst> refspec as a branch update, not a read.
- One remote:
rtk git fetch <remote>— all branches - One branch:
rtk git fetch <remote> <branch>— the result lands inFETCH_HEAD, not a tracking ref - All remotes:
rtk git fetch --all - Prune properly:
rtk git fetch --all --prune --prune-tagscleans stale branches and tags - Auto-prune:
rtk git config --global fetch.prune true(orremote.<name>.pruneto scope it to one remote), andfetch.pruneTags truefor tags
Shallow and partial fetch
rtk git fetch --depth=<n> # deepen history, or create a shallow clone
rtk git fetch --unshallow # convert a shallow clone to full history
rtk git fetch --update-shallow # allow the fetch to update the shallow boundary
rtk git fetch --refmap='' <remote> <branch> # fetch without updating any tracking ref (FETCH_HEAD only)
Default fetch refspec
The default is +refs/heads/*:refs/remotes/<name>/*. The leading + forces the update — remote-tracking branches always mirror the remote exactly and offer no protection for local history.