Git compare “base” version with “theirs” version of a conflicted file?
-
15-03-2021 - |
Domanda
Given a conflicted file foo.txt
, how to tell git diff
to show changes between the base version of the file and "their" version of the file?
I can see each of the versions via git show :1:foo.txt
or git show:3:foo.txt
- is there a simple way to compare the two versions?
Soluzione
git diff :1:foo.txt :3:foo.txt
More info at man gitrevisions; look for :[<n>:]<path>
.
Altri suggerimenti
Simply type git diff
and it will show only the conflicts.
Further reading: Advanced Merging
Notice the --base
and --theirs
arguments for diff
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow