* Undoing merges
@ 2009-12-08 17:34 rhlee
0 siblings, 0 replies; 4+ messages in thread
From: rhlee @ 2009-12-08 17:34 UTC (permalink / raw)
To: git
Hi git list,
I hope this isn't a double post. I couldn't get a response from this mailing
list with Outlook.
I'm trying to find out how to undo a merge. 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?
I've searched around, but I can seem to find an answer I can follow.
Regards,
Richard
--
View this message in context: http://n2.nabble.com/Undoing-merges-tp4133942p4133942.html
Sent from the git mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Undoing merges
@ 2009-12-08 17:16 Richard
2009-12-08 17:48 ` Matthieu Moy
0 siblings, 1 reply; 4+ messages in thread
From: Richard @ 2009-12-08 17:16 UTC (permalink / raw)
To: git
Hi git list,
I'm trying to find out how to undo a merge. 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?
I've searched around, but I can seem to find an answer I can follow.
Regards,
Richard
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Undoing merges
2009-12-08 17:16 Richard
@ 2009-12-08 17:48 ` Matthieu Moy
2009-12-14 11:42 ` Richard
0 siblings, 1 reply; 4+ messages in thread
From: Matthieu Moy @ 2009-12-08 17:48 UTC (permalink / raw)
To: Richard; +Cc: git
"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/
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: Undoing merges
2009-12-08 17:48 ` Matthieu Moy
@ 2009-12-14 11:42 ` Richard
0 siblings, 0 replies; 4+ messages in thread
From: Richard @ 2009-12-14 11:42 UTC (permalink / raw)
To: Matthieu Moy; +Cc: git
Hi again Matt,
Thanks for the reply.
> > 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
> occurred, at least in your branch). Don't do that if you already
> published this merge commit.
The problem that I'm far past the 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.
I had a look at the git-rebase man page and it showed to remove a commit
from the middle of a range of commits. I think as I am on longer on the
merge commit and cannot use "git reset --merge HEAD^", I can rebase all
the commits from the commit just after the merge onto the commit just
before the merge and that will remove the merge. Unfortunately I didn't
get a change to try that out so I don't know whether it will work or
not.
Richard
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-12-14 11:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-08 17:34 Undoing merges rhlee
-- strict thread matches above, loose matches on Subject: below --
2009-12-08 17:16 Richard
2009-12-08 17:48 ` Matthieu Moy
2009-12-14 11:42 ` Richard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox