You're doing two merges there, one from origin/master
to master
, the second from master
to develop
, and you're doing them starting from a dirty worktree.
Merges need a worktree for conflict resolution: if origin/master
and master
both change a file, git has to do some work with the content, merging any that don't affect overlapping regions and possibly punting ones that do to you for your own inspection.
Usually, the sequence you show above can run without human intervention, but the important thing to stay aware of is that, at every step (and also the git stash pop
you didn't show), it's very possible that somebody's going to have to look at a merge conflict and decide what was really meant.
Here's the example I usually give: suppose you change
if ( tag == mark
|| tag == error ) {
to
if ( g->tag == mark
|| g->tag == error ) {
and someone else changes it to
if ( tag == mark
|| tag == error
|| tag == release ) {
what is git supposed to do? I contend it does the only thing sanely possible: it punts, and asks you to decide what the result should look like. Anyone familiar with C-family languages will be all but certain that the correct resolution is
if ( g->tag == mark
|| g->tag == error
|| g->tag == release ) {
but arriving at that only when it really is the correct resolution is not within the generally accepted limits of reasonable expectation.