Andrew Grimm
Andrew Grimm

Reputation: 81570

How to avoid doing git flow release when local master is behind remote master

More than once, we've done a git flow release 1.23 on a release branch, only to discover that master was behind origin/master, and now the new master and origin/master have now diverged.

I've created a feature request to avoid this on git-flow, but apart from manually checking, is there any way to avoid finishing a release when the local master is behind the remote master?

Upvotes: 1

Views: 42

Answers (1)

VonC
VonC

Reputation: 1326782

Considering git flow release starts a release branch from develop, not master, that should not make master diverge from origin/master.

But assuming it would, you might consider writing a client pre-commit hook which would reject any new commit if it detects that master and origin/master don't match.

Upvotes: 2

Related Questions