3

qgit has the nice option of seeing "interesting" files in a merge commit, where an interesting file is defined as a file that has changes in both parents. What would be the corresponding command line to see such files?

Dov Grobgeld
  • 4,783
  • 1
  • 25
  • 36

1 Answers1

5
git show --name-status SHA1_of_merge

will show you the commit message and files modified in both parents (MM).

e.g. for the git.git repository in commit d907bf8ef32: Merge branch 'jc/index-pack' we see:

$ git show --name-status d907bf8ef327cd47433d4a4bb0a1bb4e96b6e340
commit d907bf8ef327cd47433d4a4bb0a1bb4e96b6e340
Merge: 54dbc1f 3de89c9
…

MM      builtin/index-pack.c
MM      builtin/pack-objects.c
MM      cache.h
MM      csum-file.c
MM      fast-import.c
MM      sha1_file.c

if you don't care about commit message and such, the git show manpage points you to the format used for merge commits: git diff-tree --cc. so, if you only want to see the commit hash and "interesting files" use:

$git diff-tree --cc --name-status d907bf8ef327cd47433d4a4bb0a1bb4e96b6e340
d907bf8ef327cd47433d4a4bb0a1bb4e96b6e340
MM  builtin/index-pack.c
MM  builtin/pack-objects.c
MM  cache.h
MM  csum-file.c
MM  fast-import.c
MM  sha1_file.c
knittl
  • 246,190
  • 53
  • 318
  • 364