Search code examples
gitgitlabgit-mergegit-flowmerge-request

Why git log graph of merged branch from GitLab was inverted?


git graph

As you can see in the image, feature branch number 668 has been merged into dev branch. But why the git graph appears like dev branch was merged into branch number 668 instead?

This behavior seems to happen only when do a merge request from GitLab.com. It does not happen when manually merge in a local machine.

Thanks!

EDIT: Added git graph from GitLab.com enter image description here

This is my GitLab merge request setting: enter image description here


Solution

  • There is something fishy with the two successive merge commits merge branch dev into 668-* and merge branch 668-* into dev.

    Try running :

    # you don't need the full history : '-5' will limit the log view to 5 commits
    git log --oneline --graph -5 dev
    

    You should see a sequence of commits and merge, where at some point dev was fast forwarded to 668-*.