Robin Rosenberg <> writes:

> What good reason is it that 'git stash apply' gives hairy conflict
> markers, while 'git merge stash' does not. No renames involved.

"git merge stash" is nonsensical and would do a vastly different
thing compared to "git stash apply" depending on where you created
the stash and where you are attempting to run that operation.

Imagine you started fixing a bug while on the 'master' branch,
realized that the fix equally well applies to your 'maint' branch.
You would do "git stash" followed by "git checkout maint".

A sane person would do "git stash apply" at this point.  It applies
the difference between the 'master' you were working on and your WIP
on top of your 'maint'.

"git merge stash" is entirely different.  The history leading to a
stash looks like this:

                  / \


        B is the commit you were working on (i.e. 'master');
        I records the state of the index;
        W records the state of the working tree.

and "stash" refers to W.

Think what commit B is in this example and the reason why you should
never ever do "git merge stash" will become apparent.  By merging W
into 'maint', you would be pulling the entire history between
'maint' and 'master' to the result.

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to