Re: How to create a new commit with the content of some commit?
- From
Ping Yin <pkufranky@gmail.com>
- Date
- May 12, 2009, 16:38 UTC
- Message-ID
- <46dff0320905120938m36018b45y780126df42ed4194@mail.gmail.com>
- 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:
Show 15 quoted lines
> 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?
Show 6 quoted lines
> > 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.