All of lore.kernel.org
 help / color / mirror / Atom feed
From: layer <layer@known.net>
To: Sverre Rabbelier <srabbelier@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: is there a way to reference the branch point?
Date: Wed, 03 Feb 2010 13:40:59 -0800	[thread overview]
Message-ID: <8481.1265233259@relay.known.net> (raw)
In-Reply-To: <fabb9a1e1001291435p59599f62hd54cbca66d91c24b@mail.gmail.com>

Sverre Rabbelier <srabbelier@gmail.com> wrote:

>> Heya,
>> 
>> On Fri, Jan 29, 2010 at 23:29, layer <layer@known.net> wrote:
>> > If I make a branch `foo' off master, commit a bunch of times, is there
>> > a way to reference the place on master from which I branched?
>> 
>> Depends, if you make a new branch from master, you can use 'git
>> merge-base', so:
>> 
>> $ # on master
>> $ git checkout -b foo-topic-branch
>> $ # work work
>> $ git commit
>> $ # work work
>> $ git commit
>> 
>> Now you want to know where you branches off from master:
>> 
>> $ git merge-base foo-topic-branch master
>> 
>> That will show you the commit you branches off from, even if master
>> has grown new commits since then.

That works, but what if I don't know it's off master?  Normally, a
human would, but what if this is a script I'm writing?

Thanks.

Kevin

      reply	other threads:[~2010-02-03 21:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-29 22:29 is there a way to reference the branch point? layer
2010-01-29 22:35 ` Sverre Rabbelier
2010-02-03 21:40   ` layer [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=8481.1265233259@relay.known.net \
    --to=layer@known.net \
    --cc=git@vger.kernel.org \
    --cc=srabbelier@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 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.