From: Kevin <ikke@ikke.info>
To: Woody Wu <narkewoody@gmail.com>
Cc: Seth Robertson <in-gitvger@baka.org>, git <git@vger.kernel.org>
Subject: Re: Find the starting point of a local branch
Date: Mon, 24 Dec 2012 10:12:51 +0100 [thread overview]
Message-ID: <CAO54GHDPaBqLGV7nNS-fwMZV4t_XCfDA-tAx5w7SrWWsM+YBGA@mail.gmail.com> (raw)
In-Reply-To: <20121224073103.GA10793@zuhnb712>
On Mon, Dec 24, 2012 at 8:31 AM, Woody Wu <narkewoody@gmail.com> wrote:
> But thanks anyway, I see you guys's discussions and it's a little hard
> to understand to me at the moment. Currently, I still have to use gitk
> with narrowed outputs.
Each commit refers to it's parent. If you take a branch, and keep
following the first parent of the commits, you will finally reach the
root commit (the first commit made). You don't see any branches, it's
just one straight line. That's why git can't tell you where a branch
started, because it all looks like a single branch to git.
With merge-base, you basically give git two branches, and git finds
the first ancestor that is common to both branches.
See [1] for an example. If you follow the arrows from branch a, you
get from E to A (note that commit C doesn't know about commit F
pointing to it). So it looks like there is only a single branch.
If you do git merge-base a b, git sees both branches have commit C in
common, and reports that as the merge-base.
[1]: http://g.jk.gs/9W.png
next prev parent reply other threads:[~2012-12-24 9:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-24 3:58 Find the starting point of a local branch Woody Wu
2012-12-24 4:09 ` Seth Robertson
2012-12-24 5:28 ` Nguyen Thai Ngoc Duy
2012-12-24 5:34 ` Tomas Carnecky
2012-12-24 5:45 ` Nguyen Thai Ngoc Duy
2012-12-24 6:27 ` Junio C Hamano
2012-12-24 11:21 ` Nguyen Thai Ngoc Duy
2012-12-24 19:10 ` Junio C Hamano
2012-12-25 1:09 ` Nguyen Thai Ngoc Duy
2012-12-24 6:19 ` Jeff King
2012-12-24 11:16 ` Nguyen Thai Ngoc Duy
2012-12-24 15:34 ` Jeff King
2012-12-24 7:31 ` Woody Wu
2012-12-24 9:12 ` Kevin [this message]
2012-12-24 17:24 ` Martin von Zweigbergk
2012-12-28 5:15 ` Woody Wu
2012-12-28 6:38 ` Martin von Zweigbergk
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=CAO54GHDPaBqLGV7nNS-fwMZV4t_XCfDA-tAx5w7SrWWsM+YBGA@mail.gmail.com \
--to=ikke@ikke.info \
--cc=git@vger.kernel.org \
--cc=in-gitvger@baka.org \
--cc=narkewoody@gmail.com \
/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).