0

I have a repo with master branch started from scratch and HEAD pointing on arbitrary commit. I'd like to get list of all changed files from the beginning of the branch up to commit B. I could accomplish that using

git diff --name-only A..B

But unfortunately there is no commit A.

Is there a way to point on «beginning of the time» or any other command for getting list of changed files up to specific commit?

Alvar
  • 175
  • 6

1 Answers1

2

Here is your answer:

git rev-list --max-parents=0 HEAD is the initial commit.

git diff --name-only `git rev-list --max-parents=0 HEAD`..B will show you the list of files that differ between the initial commit and commit B

EDIT:

Here a clever hack is mentioned - creating an empty tree object:

git diff --name-only $(git mktree </dev/null)..B
Community
  • 1
  • 1
BVengerov
  • 2,947
  • 1
  • 18
  • 32
  • 1
    Unfortunately, that's not the answer. I need to include first commit in the change list, not to diff starting from it. – Alvar Aug 26 '16 at 12:49