I'm new to GitFlow. Should develop branch be a mirror of master branch all the time or the other way around ?
As a background of situation, after doing so many releases (e.g. merge pull request from release branches), there are extra commits on master branch that develop branch don't have. I tempted to delete 'develop' branch and create fresh 'develop' branch.
In Git Flow, most of the time
developshould be ahead ofmaster, but perhaps in state only. In other words,developshould contain all commits onmasterexcept perhaps the merge commits caused by completing areleasebranch, which is exactly what you're witnessing. After you do the firsthotfixbranch, all of those commits will be brought intodevelopat the same time.You could just ignore those merge commits, but personally I prefer having
developbe fully up to date withmaster. Fortunately there is a simple solution to this, which is, after mergingreleaseintomaster, skip the merge ofreleaseintodevelop, and instead mergemasterintodevelop. In this way the new merge commit onmasteris also brought intodevelop. Havingdevelopbe fully ahead ofmasterin both state and commits is useful for knowing you won't accidentally blow away a hotfix in production when you deploy because someone forgot to merge it all the way down todeveloporrelease.