ff only works if you are standing on an ancestor of the branch you are trying to merge:
A <- B <- C <- (master) ^ \ D <- E <- F <- (develop) git checkout master git merge --ff-only develop
That would be ok (because master is on an ancestor of develop)
A <- B <- C <- G <- (master) ^ \ D <- E <- F <- (develop) git checkout master git merge --ff-only develop
This would not work because now master is not on an ancestor of develop.
So..... why is G there? I would not be able to know. You should be able to list that (or those) commit with this to be able to see what they are about:
git log ^develop master
Now.... if you always intend to have master on top of develop, there's more than one way to do it. The way you are attempting (git merge --ff-only) works if you are on an ancestor..... but if you always want it to work regardless of anything that you have committed in master(you don't care losing it if there's something at all), then you can do:
git checkout develop git branch -f master # set master where we are right now git checkout master
Or
git checkout master git reset --force develop
The first approach looks more efficient because the working tree is only being adjusted once whereas in the second it is twice (unless you are in master to start with).
git mergerun? I do not think that a merge is created there, if successful.... perhaps you are trying to merge a branch that has a merge at the tip, so you end up with a merge at the tip.