4 ms·
Haven't read the article yet. Whenever I'm working on a feature branch, I always tend to "merge master into the feature branch". The effect of this obviously be
by brunooliv 3y ago
Haven't read the article yet.
Whenever I'm working on a feature branch, I always tend to "merge master into the feature branch".
The effect of this obviously being that I want to have the latest changes incorporated into my work to avoid conflicts and/or to proceed with my own feature work.
This has always worked well for me and never failed me.
If I understand what rebase does correctly, it just adds all my commits in my remote feature branch to the HEAD of the branch that's being rebased onto. That's why after doing it and finishing it, one needs to do a push force because the head of the remote feature branch would diverge.
But... Why? How is this better or different than just merging master into the branch? Gitlab for example and Intellij show all the branch changes and commits with their hashes so it all can be cherry picked or reverted if needed quite easily...
Has anybody who used to "merge master into" and now uses rebase that has a much different view on it being better?
- jihadjihad 3y agoSome people don't like having standalone merge commits that show up in the git history when merging master into feature
- nomel 3y agoWhy? Is it a visual thing, or practical?
- rhinoceraptor 3y agoThis is a simple example with only two feature branches, and it's already a bit hard to follow. Imagine it with even twelve which is not even that many branches: * Merge Branch 'B' into 'main' |\ * \ Merge Branch 'A' into 'main' |\ \ | | | | | * B Commit 2 | | * Merge remote-tracking branch 'upstream/main' | * | A commit 2 | * | Merge remote-tracking branch 'upstream/main' | | * B commit 1 | |/ | * A commit 1 |/ * Compared to a commit graph where feature branches are rebased to replay their commits against the tip of main before merging: * Merge branch 'B' into 'main' |\ | * B commit 2 | * B commit 1 |/ * Merge branch 'A' into 'main' |\ | * A commit 2 | * A commit 1 |/ *