Git list of common commits between two branches

Viewed 907

We have four branches Branch A, B, C, D. Branch C is created from Branch A and Branch D is created from Branch B. We make changes to Branch D and merge them into Branch B. The same changes we cherrypick from Branch D to Branch C and merge into Branch A.

Now we want to list the names and paths of files changed in Branch A because of above behavior.

I have tried my best and now seeking your help. Thanks in advance

1 Answers

So you start (assuming A and B were created from master) with:

           d--d--d
          /
       b--b--b--b--b--b
      /
  m--m
      \
       a--a--a--a
              \
               c--c--c

You merge and cherry-pick:

           d--d--D
          /       \
       b--b--b--b--b--b
      /
  m--m
      \
       a--a--a--a------------------A
              \                   /
               c--c--c--d'--d'--d'

Try first by listing the files originally modified in branch D (with D being the commit just before merging back to A)

 git diff --name-only A...D
Related