From: Ping Yin Date: Tue, 12 May 2009 16:38:02 GMT Subject: Re: How to create a new commit with the content of some commit? 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 wrote: > Ping Yin 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.