git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Riesen <raa.lkml@gmail.com>
To: Dotan Barak <dotanba@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: How can i find the origin of a branch?
Date: Mon, 15 Jun 2009 14:07:23 +0200	[thread overview]
Message-ID: <81b0412b0906150507r7b141951w7246b0abab9624e2@mail.gmail.com> (raw)
In-Reply-To: <2f3bf9a60906150437v765c2cecva61307ae9cf0cec7@mail.gmail.com>

2009/6/15 Dotan Barak <dotanba@gmail.com>:
> Is it possible to find the origin of a branch?
> (the remote repository that this branch was cloned and checked out from)

Look for a repository which has the smallest count of commits
in common with the branch.

You can use git merge-base to find all the commits which could
possible be the point of divergence (aka "merge base"). Then
you can find all the remote branches which have the "merge bases"
(git branch --contains <base>). Any of that remote branches
could have been the origin of your local branch.

You'll seldom (if ever again) need that, I think.

P.S. You don't clone branches. Not as such. You clone repositories,
which have the commits, which a branch (as in "reference") can point to.

      parent reply	other threads:[~2009-06-15 12:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-15 11:37 How can i find the origin of a branch? Dotan Barak
2009-06-15 11:57 ` Kristian Amlie
2009-06-15 12:03   ` Dotan Barak
2009-06-15 13:34     ` Dotan Barak
2009-06-15 12:48   ` Alex Riesen
2009-06-15 13:10     ` Kristian Amlie
2009-06-15 12:07 ` Alex Riesen [this message]

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=81b0412b0906150507r7b141951w7246b0abab9624e2@mail.gmail.com \
    --to=raa.lkml@gmail.com \
    --cc=dotanba@gmail.com \
    --cc=git@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).