Dave Kennedy Dave Kennedy - 1 year ago 108
Git Question

How do I list files modified on another branch?

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?

Answer Source

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)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download