# Identifying the branch a clone was cloned from

2 messages from 2010-03-02 to 2010-03-02. Participants: jateeq, Santi Béjar.
Thread: https://gitlist.dev/t/22886

## jateeq, 2010-03-02 21:45

Subject: Identifying the branch a clone was cloned from
Message-ID: <27761617.post@talk.nabble.com>
URL: https://gitlist.dev/e/27761617.post%40talk.nabble.com

```

Hey guys,

I have a repository with over 10 branches. I clone from branch 2, and some
time after the operation I need to find out what branch in the remote I
cloned from. Anyone know the command for that?

Thank you,
Jawad.
-- 
View this message in context: http://old.nabble.com/Identifying-the-branch-a-clone-was-cloned-from-tp27761617p27761617.html
Sent from the git mailing list archive at Nabble.com.

```

## Santi Béjar, 2010-03-02 23:15

Subject: Re: Identifying the branch a clone was cloned from
Message-ID: <adf1fd3d1003021515t765b8acawa28196693da21681@mail.gmail.com>
URL: https://gitlist.dev/e/adf1fd3d1003021515t765b8acawa28196693da21681%40mail.gmail.com
In-Reply-To: <27761617.post@talk.nabble.com>

```
On Tue, Mar 2, 2010 at 10:45 PM, jateeq <jawad_atiq@hotmail.com> wrote:
>
> Hey guys,
>
> I have a repository with over 10 branches. I clone from branch 2, and some
> time after the operation I need to find out what branch in the remote I
> cloned from. Anyone know the command for that?

If you mean from which branch you forked a given branch it is
specified in the branch.<name>.remote and branch.<name>.merge + some
logic. To get it you can use the branchname@{upstream} syntax (new in
1.7.0) or use this command:

git for-each-ref --format='%(upstream)' refs/heads/branchname

But maybe we can help more if you say what you want to accomplish with
this information and not this specific detail.

HTH,
Santi

```
