From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Philip Oakley <philipoakley@iee.org>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Command to list <pattern> Branches on a specific Remote (i.e. select from rtb's)
Date: Sat, 18 May 2019 20:37:10 +0200 [thread overview]
Message-ID: <87lfz3vcbt.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <dcdff07d-77c7-8cb8-fa06-82acda5fe9ec@iee.org>
On Sat, May 18 2019, Philip Oakley wrote:
> Hi,
> I'm unsure if there is a command for this.
>
> Currently I have 1600+ remote tracking branches (rtb) for my Git repo
> as it covers both git.git and git-for-windows and some other
> contributors.
>
> Finding a specific rtb for a particular remote looks like there ought
> to be a simple command ready to do the job, but I haven't found
> anything.
>
> Is there a command or simple simple invocation of branch, show-ref,
> for-each-ref, etc that can be give a branch pattern and remote name to
> quickly filter down the list of potential branches to just one or two
> 24-line screens?
That's:
git for-each-ref 'refs/remotes/<remote>/<pattern>'
git branch -a -l '<remote>/<pattern>'
The latter will conflate <remote> with any local branches you happen to
have prefixed with <remote>.
The reason this isn't some easy mode in some command is because there's
no hard notion that a given remote "owns" a given set of RTB's. It's
just convention, but they can and do overlap sometimes.
See the logic in 'git remote remove' that needs to decide if a deletion
of a remote should delete its remote tracking refs: 7ad2458fad ("Make
"git-remote rm" delete refs acccording to fetch specs", 2008-06-01)
next prev parent reply other threads:[~2019-05-18 18:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-18 15:16 Command to list <pattern> Branches on a specific Remote (i.e. select from rtb's) Philip Oakley
2019-05-18 18:37 ` Ævar Arnfjörð Bjarmason [this message]
2019-05-18 19:44 ` Philip Oakley
2019-05-19 3:07 ` Duy Nguyen
2019-05-19 9:49 ` Philip Oakley
2019-05-28 12:13 ` [PATCH] doc branch: provide examples for listing remote tracking branches Philip Oakley
2019-05-28 13:58 ` Junio C Hamano
2019-05-28 14:17 ` Philip Oakley
2019-05-28 14:51 ` Philip Oakley
2019-05-28 15:51 ` Junio C Hamano
2019-05-28 16:17 ` Philip Oakley
2019-05-28 23:16 ` [RFC/PATCH v2] " Philip Oakley
2019-06-10 17:57 ` Junio C Hamano
2019-06-14 21:00 ` Philip Oakley
2019-05-19 3:05 ` Command to list <pattern> Branches on a specific Remote (i.e. select from rtb's) Duy Nguyen
2019-05-28 13:57 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lfz3vcbt.fsf@evledraar.gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=philipoakley@iee.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.