git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ping Yin <pkufranky@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git mailing list <git@vger.kernel.org>
Subject: Re: How to create a new commit with the content of some commit?
Date: Wed, 13 May 2009 00:38:02 +0800	[thread overview]
Message-ID: <46dff0320905120938m36018b45y780126df42ed4194@mail.gmail.com> (raw)
In-Reply-To: <7vhbzq8g7u.fsf@alter.siamese.dyndns.org>

On Tue, May 12, 2009 at 11:59 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Ping Yin <pkufranky@gmail.com> writes:
>
>> a----b
>>  \----c
>>
>> Given the graph above, I want to create a commit b1 on top of c, where
>> b1 and b have the same content. i.e.
>>
>> a----b
>>  \----c----b1    ( content(b) == content(b1) )
>
> On "c", you can:
>
>    git read-tree -m -u b
>    git commit

is -u necessary?

>
> I think with newer git you can say
>
>    git reset --merge b
>    git commit
>

When the working directory is clean, it seems "reset --hard" and
"reset --merge" behave the same. So after "git reset --merge b",  the
HEAD is moved to b, and i have nothing to commit.

  reply	other threads:[~2009-05-12 16:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-12 14:35 How to create a new commit with the content of some commit? Ping Yin
2009-05-12 15:47 ` Ping Yin
2009-05-12 16:04   ` Tomas Carnecky
2009-05-13 14:36     ` Sitaram Chamarty
2009-05-12 15:59 ` Junio C Hamano
2009-05-12 16:38   ` Ping Yin [this message]
2009-05-12 16:07 ` Jeff King
2009-05-12 16:43   ` Ping Yin
2009-05-12 16:51     ` Jeff King
2009-05-12 16:59       ` Ping Yin

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=46dff0320905120938m36018b45y780126df42ed4194@mail.gmail.com \
    --to=pkufranky@gmail.com \
    --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).