So,
I've come across this suddenly, as it, in epic blundering form, rendered my application useless, but git stash pop (or apply) automatically handles the merge conflicts. When it does this, it adds both versions to the file like so:
<<<<<<< Updated [remote]
Change from Remote
=======
Change from Stash
>>>>>>> Stashed changes
Not knowing this at first cost me some time, as those added lines invalidated the xml file.
So, i am wondering if there is a way to enforce git stash to not auto-merge but to leave the conflicts in place so they can be resolved with the git mergetool, instead of requiring me to open each file in the editor and handle the "merte" process without the benefit of the tool designed for merge conflicts.
Thanks Jaeden "Sifo Dyas" al'Raec Ruiner
The merge process used by
git stash apply
—this is the first half ofgit stash pop
—is the same as any other merge, in terms of effect left behind:At this point, regardless of whether I run
git stash apply
orgit stash pop
, I get a merge conflict and then the process stops (does not do the second half ofgit stash pop
):What's in the index now is the unmerged state, with all three copies of file
file
present:and
git mergetool
is happy enough to run at this point:All three versions of the file are present in the index at this point. Only two of them,
--ours
(usually the same as theHEAD
commit version) and--theirs
(the stashed-commit version, in this case), have convenientgit checkout
command syntax, but you can extract the merge base version too, using the:<number>:path
syntax. Runninggit mergetool
does that for you—extracts the base, left-side/local/ours
, and right-side/remote/theirs
versions—just before running your configured merge tool.Hence, I'm not really sure what your question was.