Let's say a branch has commits
X
B
A
And say master has commits
D
C
B
A
When I hit merge, does Gitlab automatically rebase and merge the branch into master?
After merging does it look like this?
X
D
C
B
A
CodePudding user response:
What exactly GitLab does when you hit "merge" depends on the merge settings of your project.
It could rebase the branch onto master (as depicted in the question), or create an actual merge commit.
The possible settings are explained here: https://docs.gitlab.com/ee/user/project/merge_requests/methods/
CodePudding user response:
No. Your final diagram is impossible (X cannot literally change its parent from B to D), but if it represents anything it would probably be a picture of the branch after a rebase, not a merge (with X copied as X'
), or a so-called "rebase-merge":
X' (branch if normal rebase, master if "rebase-merge")
D
C
B
A
A merge would create a new commit on master
with X and D as its parents (and the branch itself would be unchanged):
M (master)
/ \
(branch) X D
\ |
\ C
\|
B
|
A