What does "diverged" mean in git or git flow terminology?

Viewed 1324

When doing git flow feature start MYFEATURE I recently got the message

$ git flow feature start MYFEATURE
Branches 'develop' and 'origin/develop' have diverged.
And branch 'develop' may be fast-forwarded.

Is this use of "diverged" a git flow specific thing, or also used in git? And is one branch being an ancestor of another branch still sufficient for them to considered "diverged"? My assumption about the term "diverged" based on the English language is that both branches would have to have commits that the other branch doesn't have.

When trying to find out what "diverged" means, I came across master branch and 'origin/master' have diverged, how to 'undiverge' branches'? , but that didn't involve git flow, and involved two branches that had commits that the other branch didn't have. The term "diverged" confused a high reputation user enough that they left a comment asking for clarification.

1 Answers

The gitflow repo has a function which explains the different case in which "branches have diverged":

# git_compare_branches()
#
# Tests whether branches and their "origin" counterparts have diverged and need
# merging first. It returns error codes to provide more detail, like so:
#
# 0    Branch heads point to the same commit
# 1    First given branch needs fast-forwarding
# 2    Second given branch needs fast-forwarding
# 3    Branch needs a real merge
# 4    There is no merge base, i.e. the branches have no common ancestors

See also my older answer about diverged branches.

Related