git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David Kågedal" <davidk@lysator.liu.se>
To: Junio C Hamano <gitster@pobox.com>, git <git@vger.kernel.org>
To: bill lam <cbill.lam@gmail.com>
Subject: Re: how to rebase backwards
Date: Thu, 05 Nov 2009 20:12:29 +0100	[thread overview]
Message-ID: <877hu4zsyq.fsf@lysator.liu.se> (raw)
In-Reply-To: <20091103093716.GD7117@debian.b2j> (bill lam's message of "Tue, 3 Nov 2009 17:37:16 +0800")

bill lam <cbill.lam@gmail.com> writes:

> Thank you for detail explanation.  From what you described, I begin
> with master commit D, 
>  $ git checkout -b deploy
>  $ git commit --allow-empty -m deploy

But why on earth would you want to use --allow-empty? There is no reason
for that. Just let deploy be where it is when you created it (until you
actually add something to it).

>                       E
>                      /^ deploy
>      ---A---B---C---D
>                     ^ master
>  
>  $ git rebase -i A
>
>                       v deploy
>           B'--C'--D'--E'
>          /
>      ---A---B---C---D
>                     ^ master
>
> since E is an empty commit, I suppose content of D' E' and D are
> identical at this point.  Is that correct?

Assuming you didn't intentionally change it during rebase, yes.

> If several months later, I forget which is the common ancestor for
> master and deploy, how do I generate the above graph or identify
> commit A as the common ancestor for these two branches?

That is exactly what git does all the time. You can use many
command. For instance git log --graph master...deply whill show you both
branches, starting from their common ancestor. "git merge-base deploy
master" will tell you that the common ancestor is. Etc.

-- 
David Kågedal

  reply	other threads:[~2009-11-05 19:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-03  5:45 how to rebase backwards bill lam
2009-11-03  7:43 ` Junio C Hamano
2009-11-03  9:37   ` bill lam
2009-11-05 19:12     ` David Kågedal [this message]
2009-11-06  1:43       ` bill lam

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=877hu4zsyq.fsf@lysator.liu.se \
    --to=davidk@lysator.liu.se \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).