I'm merging two git changesets (or perhaps - in the process of git rebase
'ing, which merges changesets) involving file foo
, and have some merge conflicts. The file looks like so:
text appearing in all changesets
<<<<<<< HEAD
text added on the head
=======
something else added on another changeset
>>>>>>> 1babf8ed... commit comment here
more text appearing in all changesets
added text, no conflicts
yet more appearing in all changesets
My question:
For a specific file (like foo
above) How can I display the conflicts contents so that the HEAD revision shows up as removed text, and the other changeset (in my example) shows up as added text? In other words, how can I make some tool treat the part between <<<<<
and =====
as prefixed by -
and the part between >>>>>
and =====
as prefixed by +
, or the other way around?
Notes:
- The best thing would be just diff-like output to the standard output stream, because I could pipe that into another tool. But something with more tie-in to git's diff-related tooling is also relevant. I would rather not have to download some custom utility/app if I can reasonably avoid it.
- A side-by-side display of the HEAD and other-commit versions is also useful