Git development
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: "Richard" <richard@webdezign.co.uk>
Cc: <git@vger.kernel.org>
Subject: Re: Undoing merges
Date: Tue, 08 Dec 2009 18:48:09 +0100	[thread overview]
Message-ID: <vpqpr6pqrvq.fsf@bauges.imag.fr> (raw)
In-Reply-To: <8440EA2C12E50645A68C4AA98871665131D8D8@SERVER.webdezign.local> (richard@webdezign.co.uk's message of "Tue\, 8 Dec 2009 17\:16\:48 -0000")

"Richard" <richard@webdezign.co.uk> writes:

> Hi git list,
>
> I'm trying to find out how to undo a merge.

When sitting on a merge commit,

  git reset --merge HEAD^

will undo this merge commit (i.e. pretend the merge has never occured,
at least in your branch). Don't do that if you already published this
merge commit.

> I know that my branches are independent and that I can just carry on
> working on them and merge again later, but I'm just trying to keep
> my revision graph tidier. Should I even be undoing merges?

If it's about cleaning up your history, "git rebase" is your friend,
too (with the same limitation: don't do that on published history). By
default, it does some kind of history flattening.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

  reply	other threads:[~2009-12-08 17:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-08 17:16 Undoing merges Richard
2009-12-08 17:48 ` Matthieu Moy [this message]
2009-12-14 11:42   ` Richard
  -- strict thread matches above, loose matches on Subject: below --
2009-12-08 17:34 rhlee

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=vpqpr6pqrvq.fsf@bauges.imag.fr \
    --to=matthieu.moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=richard@webdezign.co.uk \
    /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