It happens that information about a merge are lost after we do a stash. A usual merge and a stashed merge are compared below.
Right: merge + push
git merge release-2013-10-29
# Everything works, cool
git commit -am "Upgraded to release 2013-10-29"
git push origin dev
Result is as expected, a merge commit:
Wrong: merge + stash + push
Here I am in a scenario where I need to stash the merge changes just in order to have a look at the previous-to-the-merge behaviour.
git merge release-2013-11-06
# Conflicts fixed, but detected inappropriate behaviour
git stash
git stash pop
git commit -am "Upgraded to release 2013-11-06"
git push origin dev
Result: this commit is not a "merge" anymore. We also lost all single authored commits contained by the merge, just like if I would have made all these changes.
So, shouldn't we stash anything when merging? How to avoid such behaviour then?