In Git in master-branch I have these files:
foo1.txt
foo2.txt
bar1.txt
bar.txt
Then I create branch A and modify files foo1.txt
and foo2.txt
.
After this I go back to master-branch and create branch B in
which I modify files bar1.txt
and foo1.txt
. Please note that foo1.txt
is the only file, which is modified by both branches A and B.
Now I would like to get a list of files, which were modified by branches A and B. This would be very helpful to check for any conflicts before I merge branch A into branch B .
I tried this, but this give me only the differences between branch A and B:
git diff A B --name-only
bar1.txt
foo1.txt
foo2.txt
How can I get get a list of files, which were modified by branches A and B ?
The expected list has the only entry foo1.txt