zaza
zaza

Reputation: 1419

How can I find out which files have been modified in a branch?

I have two branches: master and bug1. I checked out bug1, did bunch of changes and multiple commits. How do I get a list of all files that were changed on the branch? I'm not interested in hashes, dates or any other commit related details. I just want to get a simple list of touched files.

Upvotes: 43

Views: 18479

Answers (3)

Starman
Starman

Reputation: 356

The answer given on a question that was suggested to be a duplicate of this one, is a more correct answer to this question.

If you follow any other answers currently on this page here, you will also get in your output, any changes that have happened to master during the time that the files you are actually interested in were modified on branch.

So they are only correct in the limited subset of cases where your master happens to look exactly how it did back when the branch was forked off.

The question here specifies that it wants only the files that were modified along the branch (i.e. relative to the fork point, or "merge-base" of branch and master)

Upvotes: 1

Tim Henigan
Tim Henigan

Reputation: 62218

From your master:

git diff --name-status BRANCH

See the git diff man page for details.

Upvotes: 12

Cory Petosky
Cory Petosky

Reputation: 12656

git diff --name-only master bug1

Upvotes: 73

Related Questions