Description 582 -> 237 chars, body 1217 -> 290 words. The single remotes.md splits into config, fetch, push, and pull flow files. Restores the confirm: true token to the force-push gate -- it is the git plugin's cross-skill contract, gated on by git-orchestrate and git-branches. Moves push.md's worked example off main, which the skill's own Step 1 refuses, and restores the never-bare---force directive.
1.2 KiB
1.2 KiB
topic, source_keys
| topic | source_keys | ||
|---|---|---|---|
| fetch |
|
Fetching
Fetch updates remote-tracking branches (refs/remotes/<name>/*) and never modifies a local branch, so it is always safe to run.
- One remote:
git fetch <remote>— all branches - One branch:
git fetch <remote> <branch>— the result lands inFETCH_HEAD, not a tracking ref - All remotes:
git fetch --all - Prune properly:
git fetch --all --prune --prune-tagscleans stale branches and tags - Auto-prune:
git config --global fetch.prune true(orremote.<name>.pruneto scope it to one remote), andfetch.pruneTags truefor tags
Shallow and partial fetch
git fetch --depth=<n> # deepen history, or create a shallow clone
git fetch --unshallow # convert a shallow clone to full history
git fetch --update-shallow # allow the fetch to update the shallow boundary
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.