Same as Adam's answer , but using an index and without a cut:
sub="path/to/submodule" git --git-dir="$sub/.git" diff \ $(git rev-parse ":2:$sub") \ $(git rev-parse ":3:$sub")
Explanation:
When there is a conflict, Git stores information about this in the index. It stores several different versions, the so-called stages. Stage 1 is the "basic" version (common ancestor), stage 2 is the "our" version, and stage 3 is the "their" version.
In case of file conflicts, the index contains blob object identifiers for different versions. In the case of submodules, these are identifiers for fixing the submodule. In the command above :2:$sub refers to step 2 (ours) of the submodule in the path of $sub .
Note that you can see a list of index entries with steps with git ls-files --stage .
source share