These aliases now make zero assumptions about either branch or origin
names. They default to origin, and the primary branch is determined from
the refs/remotes/$remote/HEAD symbolic-ref, which will be pulled from
the remote if it's not known locally.
With these it is now possible to act on any remote/branch combination:
# Get default branch for 'upstream' remote
$ git defbranch upstream
# Delete branches merged into the default branch of the 'upstream'
# remote
$ git cleanmerged upstream
# Delete branches merged into the upstream/foo branch
$ git cleanmerged upstream foo
Signed-off-by: Joe Groocock <me@frebib.net>
This broadly assumes that the "default" remote is called "origin", but
that's better than assuming that plus the default branch name.
Thanks to https://joshtronic.com/2020/08/09/how-to-get-the-default-git-branch/
Suggested-by: Chris Lane <chris@chrislane.com>
Signed-off-by: Joe Groocock <me@frebib.net>
I can't find a way to make this a wildcard that applies to all remotes,
so this adds the two most common remotes that I'm likely to use.
Signed-off-by: Joe Groocock <me@frebib.net>