[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Git conflicts
From: |
Johannes Schindelin |
Subject: |
Re: Git conflicts |
Date: |
Sat, 21 Jun 2008 19:06:34 +0100 (BST) |
User-agent: |
Alpine 1.00 (DEB 882 2007-12-20) |
Hi,
On Sat, 21 Jun 2008, Rune Zedeler wrote:
> Valentin Villenave skrev:
>
> > When I merged your branch several weeks ago I didn't encounter any
> > problem. So I must have screwed up something when you asked me to
> > revert this merge...
>
> I do not think you did anything wrong. My guess is that git lacks the
> functionality of "registering" a revert as a revert, and therefore kept
> thinking that my branch was depending on your branch - even after you
> did the revert og the merge.
I think the problem really is that "revert" is meant for non-merge
commits.
In other words, it will undo the _changes_ of a commit, but not the commit
itself.
So, Git still thought that you had a branch-off at the point the merge
happened, but the changes of the merge were _undone_. So the assumptions
of Git's merge algorithm did not work at all.
FWIW the proper way to undo a merge is to
$ git rebase --onto MERGE_HEAD^ MERGE_HEAD
where MERGE_HEAD has to be substituted by the merge commit that you want
to undo. (This command transplants the commits you did since the merge
onto the commit which was current right before the merge.)
Note: this rewrites history, so if you pushed it already, people pulling
from you (as opposed to fetching) will not be happy with you pushing a
rewritten history.
Ciao,
Dscho
- Re: Git conflicts, (continued)
- Re: Git conflicts, Johannes Schindelin, 2008/06/20
- Re: Git conflicts, Rune Zedeler, 2008/06/20
- Re: Git conflicts, Rune Zedeler, 2008/06/20
- Re: Git conflicts, Rune Zedeler, 2008/06/20
- Re: Git conflicts, John Mandereau, 2008/06/20
- Re: Git conflicts, Rune Zedeler, 2008/06/22
- Re: Git conflicts, Valentin Villenave, 2008/06/22
Re: Git conflicts, Rune Zedeler, 2008/06/21
Re: Git conflicts,
Johannes Schindelin <=
Re: Git conflicts, Rune Zedeler, 2008/06/22
Re: Git conflicts, Johannes Schindelin, 2008/06/22