diff --git a/README.md b/README.md index d69a042..95b037f 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,12 @@ doing so. `git remote` sorts alphabetically, so picking the first remote in be-edition returns `kdog` — a colleague's fork. nvim's `gm` (diff-against-branch) tries `origin`, then `upstream`, then the rest. +One wrinkle: setting `remote.origin.followRemoteHEAD` at all is enough for git to +invent the remote, so `git remote` lists a URL-less `origin` in repos that have +none — this one, whose remotes are `forge` and `github`. It is a listing +artefact, not a real remote: `git remote get-url origin` still fails, so the +`origin` guard in `git sync` and the fallbacks in `gm` behave. + ## Light and dark mode Most of this is now handled natively and needs no configuration: diff --git a/gitconfig b/gitconfig index c4360af..9dcf1f6 100644 --- a/gitconfig +++ b/gitconfig @@ -47,6 +47,12 @@ # branch that may not even exist. `always` re-points it on each fetch, off the # ref advertisement that fetch already receives, so it costs no extra round # trip. Only applies to remotes actually named origin. + # + # Side effect: git conjures a remote from the existence of any remote..* + # key, so this makes `git remote` list a URL-less origin in every repo that + # has not got one - this repo included. Nothing breaks (`git remote get-url + # origin` still says No such remote, which is what the scripts test), but do + # not read that listing as evidence a real origin exists. followRemoteHEAD = always [core]