1

I would like to get a list of files which were changed in branch, since branch was created.

Example:

  • create branch B1

  • commit change in file_1

  • commit change in file_2

Result should be: file_1 file_2

How to do that?

I'm NOT interested in difference between Master and B1.

I'm interested in difference between current state of B1 and primary state of B1.

Thanks for responses

MPAW
  • 1,353
  • 1
  • 9
  • 17
  • You could just diff between the first commit and the last ? Get the first commit via git log master..branch --oneline | tail -1 (http://stackoverflow.com/questions/18407526/git-how-to-find-first-commit-of-specific-branch) – telina Oct 04 '16 at 12:29
  • Thank you for response. What is first commit? Is it branching operation? Because if first commit is commit that i made on branch making commit. Then I suppose i loose change from first commit. In mine example, the result would be file_2, or i'm wrong? – MPAW Oct 04 '16 at 12:34
  • Possible duplicate (but maybe not, but definitely suggested reading): http://stackoverflow.com/q/39837542/1256452 – torek Oct 04 '16 at 14:13

1 Answers1

0

First, find the diverge point using

git merge-base master b1

Then use

git diff --stat <commit-id>..b1
blue112
  • 52,634
  • 3
  • 45
  • 54
  • Thank you for response. I've used git diff as you wrote but it returns me nothing. I tried also git diff --stat master..b1 - it worked. Why? :( – MPAW Oct 04 '16 at 13:19