I just noticed that if we have local and origin/develop
looking like
local: A---B
origin/develop: A---B
If I then do git flow feature start Z
and work for a while I might end up with:
local: A---B
origin/develop: A---B---C---D
I now do git flow feature finish Z
and I get a warning about:
Branches 'develop' and 'origin/develop' have diverged.
And local branch 'develop' is ahead of 'origin/develop'
I now have (no push):
local: A---B---Z
origin/develop: A---B---C---D---E
I try to do git pull
and down comes a bunch of updates that git merges into develop
, so I end up with:
local: A---B---Z-----------Z'
\--C---D---E--/
origin/develop: A---B---C---D---E
If I do a git push origin/develop
I'm going to muck up our nice neat single develop
stream, so after some googling I ended up doing:
git pull --rebase --prune
git push origin develop
This restored me to:
local: A---B---C---D---E---Z
origin/develop: A---B---C---D---E---Z
Doing this I actually discovered that a previous feature had also failed because of the same problem... I thought we used git flow
to hide all these common niggles and pitfalls.
So, am I using git flow
wrongly? Is there some extra command one should always do before feature finish
to ensure you don't get out of sync?