Re:Git pretty
by bellerocky on Saturday September 06, 2014 @02:25PM
(#8279043)
Reverting a merge is totally OK if you kept your history clean and rebased the branch you're merging into to get updates instead of merging it into your branch.
Like if you created a new branch from master and you have been merging master into your branch to get updates in master, once you merge your branch into master you cannot revert this merge because the act of merging master into your branch changed which branch owned commits.
If you rebased master into your branch instead everything will be fine. If you merge your branch into master, reverting that merge will simply undo the merge as you expected.
I've read that doc and other warnings about reverting a merge. But I've found that if you revert the revert, then you avoid the problems they mention. I guess the worry is that you still have to remember to do that, or you'll have commits that silently never merge. But if you do remember, then reverting the revert makes things okay. But I'm no expert. Can anyone else confirm this for me?
Yes, the correct way to do it is to revert the revert. js2's link above outlines how and why in detail.
Re:Git pretty
by michaelmior on Saturday September 06, 2014 @07:42PM
(#8279880)
While I agree this guide is great, I think opinionated and correct are mutually exclusive.
Re:Git pretty
by chrisweekly on Sunday September 07, 2014 @08:48AM
(#8280975)
"...opinionated and correct are mutually exclusive."
TIMTOWTDI.
Re:Git pretty
by michaelmior on Sunday September 07, 2014 @10:56PM
(#8283240)
Very true, but whenever that is the case, there are typically some who decide their way is the "right" way for various reasons.
Guess what happens if you try to git revert a merge? Yeah. Don’t do that.
You can, but you really need to understand what happens when you do so, so that you're not confused by future merges from the same branch. Straight from the horse's mouth:
https://www.kernel.org/pub/software/scm/git/docs/howto/rever...