I have an old stash of working tree that is now some dozens of commits old. This stash nevertheless still represents useful work on a feature I need to bring forth. I abandoned it prior as I had to switch to a higher-priority feature since, stashing the former. Now, as always, my master
represents current state of the art, obviously, but I need to take up work on the old feature. I don't think I want or need rebase at all. In fact, I won't be committing (other than stashing) until the feature is done.
Since stashes are commits, I thought I'd see if I can produce a working tree incorporating the said abandoned feature work and the current master branch. I did:
git checkout stash@{0}
git merge --no-ff --no-commit master
The long options for git merge
were just to make sure I have a chance to review the merge. What was surprising was that everything went butter smooth. Looking at the two versions of one file that had most changes, it's obvious to me that I do not want the merge Git did.
Now, what I want is for Git to produce the kind of file(s) I get when I have merge conflicts -- one with <<<<<
and >>>>>
giving me sections that are different. I will edit these file(s) into a sensible state and just take it from there, no problem.
Either that or I am preparing to use git format-patch
and git merge-file
(which I am unsure of as I never used it) to give me a patch file which I will tweak and apply on top of stash@{0}
most likely.
What is the idiomatic way to "induce" a case of merge conflict as described, even in situation where Git does not see one?