All of lore.kernel.org
 help / color / mirror / Atom feed
* A couple of minor branching questions
@ 2009-02-24  0:38 Alan
  2009-02-24  1:29 ` Jakub Narebski
  0 siblings, 1 reply; 2+ messages in thread
From: Alan @ 2009-02-24  0:38 UTC (permalink / raw)
  To: git

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.

Thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: A couple of minor branching questions
  2009-02-24  0:38 A couple of minor branching questions Alan
@ 2009-02-24  1:29 ` Jakub Narebski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Narebski @ 2009-02-24  1:29 UTC (permalink / raw)
  To: Alan; +Cc: git

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-02-24  1:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-24  0:38 A couple of minor branching questions Alan
2009-02-24  1:29 ` Jakub Narebski

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.