2

Before I merge branch B into branch A, I'd like to see a list of files modified (or added, deleted, etc.) on branch B. I know I can:

git diff --name-only B

But that list includes files changed on A as well. I only want to see files that were changed on B (but it's okay if they were also changed on A).

This is pretty close:

git log --name-only ..B

But that splits the list into separate commits. How can I generate a single list of files modified on B?

Big McLargeHuge
  • 14,841
  • 10
  • 80
  • 108

1 Answers1

2

If you consider "What are the differences between double-dot “..” and triple-dot “…” in Git diff commit ranges?", you can try:

git diff --name-only A...B

(you can see in this answer the git commit ranges used by git log)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • This is no doubt the right answer (and upvoted) but it's worth mentioning that any time you ask "what changed", you're implicitly assuming a *starting point*. ("What changed at the grocery store?" "Well, 50 years ago, there was no store, then they broke ground..." "No, I mean, *since yesterday*." "Oh.") In order to show you *what changed*, you have to specify a *since when*. The point of the `A...B` notation is to have Git find a suitable "since when" for you. – torek Nov 29 '16 at 20:52