3 ms·
Merges go wrong sometimes. That's life. That mismerge would have been just as bad if they had rebased instead, except you wouldn't have had the context to go b
by Nullabillity 2y ago
Merges go wrong sometimes. That's life.
That mismerge would have been just as bad if they had rebased instead, except you wouldn't have had the context to go back and fix it. How would that be better?
- exceptione 2y agoIf your merge goes wrong, you should rip it out of your feature branch. You use git rebase -i for that, or git reset even. But you shouldn't merge into your feature branch at all. We are interested in how your commits change what becomes before it in mainline. We are not interested in how main differed from your feature branch at various points in time. Git rebase is wonderful for people that create mess when working. Your feature branch can contain lots of WIPs for all the times you hit five 'o clock. With interactive rebase you can clean up your mess: squash, split, delete and reorder commits. You can do this all graphically even, like drag-drop reordering of commits. Also read up about git fixup and friends for quick fixes. There is also git rebase abort if you think you are doing something wrong.