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.
2.1 KiB
2.1 KiB
topic, source_keys
| topic | source_keys | ||
|---|---|---|---|
| remote-config |
|
Remote configuration
Which remotes exist, where they point, and what they track.
git remote show <name> needs network access — use -n for cached data offline, or git remote -v, which lists URLs without querying.
Add, remove, rename, inspect
- Add:
git remote add <name> <url>, or-fto fetch immediately - Remove:
git remote remove <name>— deletes the remote, all its tracking refs, and its config - Rename:
git remote rename <old> <new> - Inspect:
git remote -v(URLs, offline) orgit remote show <name>(live tracking status) - Effective URLs:
git remote get-url <name>shows the URL afterinsteadOfrewrites;git remote get-url --push --all <name>lists every push URL
Tracking, mirroring, housekeeping
- Track one branch:
git remote add -t <branch> <name> <url>(repeatable);--no-tagssuppresses tag import entirely - Mirror:
--mirror=fetchmirrors all refs locally (bare repos only);--mirror=pushmakes every push behave like--mirror - Prune stale tracking refs without fetching:
git remote prune <name>, with--dry-runto preview - Default branch pointer:
git remote set-head <name> -a(auto-detect, needs a prior fetch),... <branch>(explicit),... -d(deleterefs/remotes/<name>/HEAD)
set-url — full form
git remote set-url <name> <newurl> # replace the first fetch URL
git remote set-url <name> <newurl> <oldurl-regex> # replace only the URL matching regex
git remote set-url --push <name> <url> # change push URL only (must point at same repo)
git remote set-url --add <name> <url> # add an extra push URL (push to multiple remotes)
git remote set-url --delete <name> <regex> # remove URLs matching regex
--push changes only where pushes go — fetch and push URLs must still reference the same repository. For genuine fetch-from-A / push-to-B workflows, use two separate named remotes instead; --push cannot do this.