Re: [PATCH] revisions: add @{default} shorthand for default branch
- From
Harald Nordgren <haraldnordgren@gmail.com>
- Date
- Feb 2, 2026, 23:03 UTC
- Message-ID
- <20260202230302.13009-1-haraldnordgren@gmail.com>
- In-Reply-To
- <CALnO6CDrdfSFuY8xjvno3+2MVB2JHUYdNsYTYqqRsfcDiWa1uQ@mail.gmail.com>
> That just makes discovering the name of the remote the "interesting" part…
Yeah, this is true! Discovering which is the upstream remote is still non-trivial. It's aggravated because the GitHub 'gh' tool will rename 'origin' to 'upstream' when forking + creating PR from the CLI.
Which I why I do this becomes necessary
git remote | rg '^(origin|upstream)$' | tail -n1
Harald