public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail•com>
To: Alan <alan@clueserver•org>
Cc: git@vger•kernel.org
Subject: Re: A couple of minor branching questions
Date: Mon, 23 Feb 2009 17:29:10 -0800 (PST)	[thread overview]
Message-ID: <m3tz6kvd0b.fsf@localhost.localdomain> (raw)
In-Reply-To: <1235435927.12677.2.camel@rottwang.fnordora.org>

Alan <alan@clueserver•org> writes:

> Is there an easy way to tell what commit a branch is branched off from?
> Also, it there a way to tell what branch the branch is branched off
> from? 
> 
> I know I can use gitk to give a visual diagram, but I want something I
> can feed into a program.

First you can check branch.<branchname>.merge configuration option
(with git-config) to check what branch (by _remote_ name) given branch
is based on.

Second, you can use "git merge-base <branchname> <second branch>" to
find common ancestor, i.e. branching point of two branches. By the
way, there is shortcut a..b and a...b for revision ranges: see
documentation in git-rev-parse (or was it git-rev-list?).

-- 
Jakub Narebski
Poland
ShadeHawk on #git

      reply	other threads:[~2009-02-24  1:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-24  0:38 A couple of minor branching questions Alan
2009-02-24  1:29 ` Jakub Narebski [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=m3tz6kvd0b.fsf@localhost.localdomain \
    --to=jnareb@gmail$(echo .)com \
    --cc=alan@clueserver$(echo .)org \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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