# Finding all branches(remote and local) include given commit?

6 messages from 2012-05-12 to 2012-05-12. Participants: Yi, EungJun, Carlos Martín Nieto.
Thread: https://gitlist.dev/t/30520

## Yi, EungJun, 2012-05-12 11:42

Subject: Finding all branches(remote and local) include given commit?
Message-ID: <CAFT+Tg9nJZ7E3FB3nA6+_TR=KUqu80128rL8b2DuRGtBavsj-Q@mail.gmail.com>
URL: https://gitlist.dev/e/CAFT%2BTg9nJZ7E3FB3nA6%2B_TR%3DKUqu80128rL8b2DuRGtBavsj-Q%40mail.gmail.com

```
Is there any way to find remote and local branches include given commit?

e.g.

$ git branch --all --contains 499e7b31509cfbb59dcb2a046f8e2fd1a3e73d6f
* master
  remotes/origin/next

As you know, it does not work and "git branch --contains" finds only
local branches.

```

## Carlos Martín Nieto, 2012-05-12 12:07

Subject: Re: Finding all branches(remote and local) include given commit?
Message-ID: <1336824434.3002.17.camel@centaur.lab.cmartin.tk>
URL: https://gitlist.dev/e/1336824434.3002.17.camel%40centaur.lab.cmartin.tk
In-Reply-To: <CAFT+Tg9nJZ7E3FB3nA6+_TR=KUqu80128rL8b2DuRGtBavsj-Q@mail.gmail.com>

```
On Sat, 2012-05-12 at 20:42 +0900, Yi, EungJun wrote:
> Is there any way to find remote and local branches include given commit?
> 
> e.g.
> 
> $ git branch --all --contains 499e7b31509cfbb59dcb2a046f8e2fd1a3e73d6f
> * master
>   remotes/origin/next
> 
> As you know, it does not work and "git branch --contains" finds only
> local branches.

Works For Me. What version are you trying it with? Are you sure that
remote-tracking branches do contain that commit?

>From a quick look through the log and release notes, it was never
mentioned as a fix. The log contains 3f7701a4 from 2007 which fixes 'git
describe --all --contains' which, though unlikely, might be related.
This commit was however part of release 1.5.4, which makes it unlikely
you'd be using something older.

   cmn

```

## Yi, EungJun, 2012-05-12 12:25

Subject: Re: Finding all branches(remote and local) include given commit?
Message-ID: <CAFT+Tg-cYCatcaP3fR7X7+GnpazUb3ys96A5AP6HTjvD_=+UyQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAFT%2BTg-cYCatcaP3fR7X7%2BGnpazUb3ys96A5AP6HTjvD_%3D%2BUyQ%40mail.gmail.com
In-Reply-To: <1336824434.3002.17.camel@centaur.lab.cmartin.tk>

```
Wow, I should do like this:

$ git branch -a --contains 499e7b31509cfbb59dcb2a046f8e2fd1a3e73d6f
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
  remotes/origin/next
  remotes/origin/pu

git-branch has '-a' but not '-all', and git-remote has '--all' but not '-a'.

This is a bit confusing for me. Why don't the two commands have the
option under the same name?


2012/5/12 Carlos Martín Nieto <cmn@elego.de>:
> On Sat, 2012-05-12 at 20:42 +0900, Yi, EungJun wrote:
>> Is there any way to find remote and local branches include given commit?
>>
>> e.g.
>>
>> $ git branch --all --contains 499e7b31509cfbb59dcb2a046f8e2fd1a3e73d6f
>> * master
>>   remotes/origin/next
>>
>> As you know, it does not work and "git branch --contains" finds only
>> local branches.
>
> Works For Me. What version are you trying it with? Are you sure that
> remote-tracking branches do contain that commit?
>
> From a quick look through the log and release notes, it was never
> mentioned as a fix. The log contains 3f7701a4 from 2007 which fixes 'git
> describe --all --contains' which, though unlikely, might be related.
> This commit was however part of release 1.5.4, which makes it unlikely
> you'd be using something older.
>
>   cmn
>

```

## Yi, EungJun, 2012-05-12 12:28

Subject: Re: Finding all branches(remote and local) include given commit?
Message-ID: <CAFT+Tg81f-fa-hf0jJ-y0TP99WbUGxVRAoxDyALd33cgaPrboQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAFT%2BTg81f-fa-hf0jJ-y0TP99WbUGxVRAoxDyALd33cgaPrboQ%40mail.gmail.com
In-Reply-To: <CAFT+Tg-cYCatcaP3fR7X7+GnpazUb3ys96A5AP6HTjvD_=+UyQ@mail.gmail.com>

```
Oops, it's just my mistake. git-remote also does not have '--all' option.

2012/5/12 Yi, EungJun <semtlenori@gmail.com>:
> Wow, I should do like this:
>
> $ git branch -a --contains 499e7b31509cfbb59dcb2a046f8e2fd1a3e73d6f
> * master
>  remotes/origin/HEAD -> origin/master
>  remotes/origin/master
>  remotes/origin/next
>  remotes/origin/pu
>
> git-branch has '-a' but not '-all', and git-remote has '--all' but not '-a'.
>
> This is a bit confusing for me. Why don't the two commands have the
> option under the same name?
>
>
> 2012/5/12 Carlos Martín Nieto <cmn@elego.de>:
>> On Sat, 2012-05-12 at 20:42 +0900, Yi, EungJun wrote:
>>> Is there any way to find remote and local branches include given commit?
>>>
>>> e.g.
>>>
>>> $ git branch --all --contains 499e7b31509cfbb59dcb2a046f8e2fd1a3e73d6f
>>> * master
>>>   remotes/origin/next
>>>
>>> As you know, it does not work and "git branch --contains" finds only
>>> local branches.
>>
>> Works For Me. What version are you trying it with? Are you sure that
>> remote-tracking branches do contain that commit?
>>
>> From a quick look through the log and release notes, it was never
>> mentioned as a fix. The log contains 3f7701a4 from 2007 which fixes 'git
>> describe --all --contains' which, though unlikely, might be related.
>> This commit was however part of release 1.5.4, which makes it unlikely
>> you'd be using something older.
>>
>>   cmn
>>

```

## Carlos Martín Nieto, 2012-05-12 12:48

Subject: Re: Finding all branches(remote and local) include given commit?
Message-ID: <1336826919.3002.18.camel@centaur.lab.cmartin.tk>
URL: https://gitlist.dev/e/1336826919.3002.18.camel%40centaur.lab.cmartin.tk
In-Reply-To: <CAFT+Tg-cYCatcaP3fR7X7+GnpazUb3ys96A5AP6HTjvD_=+UyQ@mail.gmail.com>

```
On Sat, 2012-05-12 at 21:25 +0900, Yi, EungJun wrote:
> Wow, I should do like this:
> 
> $ git branch -a --contains 499e7b31509cfbb59dcb2a046f8e2fd1a3e73d6f
> * master
>   remotes/origin/HEAD -> origin/master
>   remotes/origin/master
>   remotes/origin/next
>   remotes/origin/pu
> 
> git-branch has '-a' but not '-all', and git-remote has '--all' but not '-a'.

The branch command has had long-form since 1.7.8

> 
> This is a bit confusing for me. Why don't the two commands have the
> option under the same name?
> 
> 
> 2012/5/12 Carlos Martín Nieto <cmn@elego.de>:
> > On Sat, 2012-05-12 at 20:42 +0900, Yi, EungJun wrote:
> >> Is there any way to find remote and local branches include given commit?
> >>
> >> e.g.
> >>
> >> $ git branch --all --contains 499e7b31509cfbb59dcb2a046f8e2fd1a3e73d6f
> >> * master
> >>   remotes/origin/next
> >>
> >> As you know, it does not work and "git branch --contains" finds only
> >> local branches.
> >
> > Works For Me. What version are you trying it with? Are you sure that
> > remote-tracking branches do contain that commit?
> >
> > From a quick look through the log and release notes, it was never
> > mentioned as a fix. The log contains 3f7701a4 from 2007 which fixes 'git
> > describe --all --contains' which, though unlikely, might be related.
> > This commit was however part of release 1.5.4, which makes it unlikely
> > you'd be using something older.
> >
> >   cmn
> >
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

```

## Yi, EungJun, 2012-05-12 12:52

Subject: Re: Finding all branches(remote and local) include given commit?
Message-ID: <CAFT+Tg9rnYAkEVC+kyf=rfXgVLvzSSa+fzqy9ocEZ+rRbA82uw@mail.gmail.com>
URL: https://gitlist.dev/e/CAFT%2BTg9rnYAkEVC%2Bkyf%3DrfXgVLvzSSa%2Bfzqy9ocEZ%2BrRbA82uw%40mail.gmail.com
In-Reply-To: <1336826919.3002.18.camel@centaur.lab.cmartin.tk>

```
> The branch command has had long-form since 1.7.8

That sounds good to me! Thanks for letting me know.

2012/5/12 Carlos Martín Nieto <cmn@elego.de>:
> On Sat, 2012-05-12 at 21:25 +0900, Yi, EungJun wrote:
>> Wow, I should do like this:
>>
>> $ git branch -a --contains 499e7b31509cfbb59dcb2a046f8e2fd1a3e73d6f
>> * master
>>   remotes/origin/HEAD -> origin/master
>>   remotes/origin/master
>>   remotes/origin/next
>>   remotes/origin/pu
>>
>> git-branch has '-a' but not '-all', and git-remote has '--all' but not '-a'.
>
> The branch command has had long-form since 1.7.8
>
>>
>> This is a bit confusing for me. Why don't the two commands have the
>> option under the same name?
>>
>>
>> 2012/5/12 Carlos Martín Nieto <cmn@elego.de>:
>> > On Sat, 2012-05-12 at 20:42 +0900, Yi, EungJun wrote:
>> >> Is there any way to find remote and local branches include given commit?
>> >>
>> >> e.g.
>> >>
>> >> $ git branch --all --contains 499e7b31509cfbb59dcb2a046f8e2fd1a3e73d6f
>> >> * master
>> >>   remotes/origin/next
>> >>
>> >> As you know, it does not work and "git branch --contains" finds only
>> >> local branches.
>> >
>> > Works For Me. What version are you trying it with? Are you sure that
>> > remote-tracking branches do contain that commit?
>> >
>> > From a quick look through the log and release notes, it was never
>> > mentioned as a fix. The log contains 3f7701a4 from 2007 which fixes 'git
>> > describe --all --contains' which, though unlikely, might be related.
>> > This commit was however part of release 1.5.4, which makes it unlikely
>> > you'd be using something older.
>> >
>> >   cmn
>> >
>> --
>> To unsubscribe from this list: send the line "unsubscribe git" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
>
>

```
