In this documentation it is mentioned A commit object may have any number of parents.But from my understanding, the only case where a commit will have more than 1 parent is when a merge has happened, and in that case there will only be two parents. So my question is, can a commit have more than 2 parents? If so, when?
Can a git commit have more than 2 parents?
git
You can use git merge to merge more than one commit into your current branch. From man git-merge (or git help merge):git-merge - Join two or more development histories togetherThe result will be a commit with more than two parents when you do that.