Re: A couple of minor branching questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alan <alan@xxxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux