This can happen in cases like the one described at https://stackoverflow.com/questions/26370185/how-do-criss-cross-merges-arise-in-git This documentation explains how the git handles those cases: https://git-scm.com/docs/merge-strategies/2.14.6