Synesso
Synesso

Reputation: 38958

List new files added (by anyone) between two dates

How can I list the files that were newly added in commits between two dates (or between two commits)? I'd like to see

  1. The file path
  2. The committer/commit message
  3. The commit ref

Upvotes: 6

Views: 3232

Answers (3)

Gra
Gra

Reputation: 1594

this is what I use:

git log --diff-filter=A --name-only --pretty=oneline --abbrev-commit ref1..ref2

Moreover, the output is quite easy to parse. Removing --abbrev-commit allows you to use the SHA-1 for some job.

Upvotes: 8

atkretsch
atkretsch

Reputation: 2397

You can also use git show. It's similar to git log but has a --name-status parameter that gives you both the path name and the added/modified/deleted flag in one shot (note that git log as described in the first answer isn't restricted to new files and doesn't display a status indicator).

$ git show --pretty=fuller --name-status HEAD^..HEAD
commit 3c92149119e69b4520b4ea317f221aade9f41b0e
Author: John Doe <xxxx@xxxxxx>
AuthorDate: Fri Nov 9 15:46:05 2012 -0600
Commit: John Doe <xxxx@xxxxxx>
CommitDate: Fri Nov 9 15:46:05 2012 -0600

Added some files, modified some other files

A       src/main/java/com/test/app/NewFile1.java
A       src/main/java/com/test/app/NewFile2.java
M       src/main/java/com/test/app/OldFile1.java
M       src/main/java/com/test/app/OldFile2.java

Might be possible to get this info with git log (they're probably using the same basic info under the hood) but I haven't figured it out.

Upvotes: 4

Stecman
Stecman

Reputation: 3060

git log --stat gives a nice summary of commits with details of files changed:

commit bde0ce475144ec85a1cb4ffeba04815412a07119
Author: Stephen Holdaway <[email protected]>
Date:   Thu Sep 20 13:55:12 2012 +1200

    fix default rotation issue

 Menus/MainMenuViewController.m   |   17 +++++++++++++----
 Menus/PostGameViewController.m   |   14 +++++++++++++-
 Menus/StatsMenuController.m      |   10 +++++-----
 4 files changed, 31 insertions(+), 11 deletions(-)

You could try this for between two dates:

git log --since "10 Sep 2012" --until "12 Nov 2012" --stat

And this for between two commits:

git log --stat xxxxxxx..xxxxxxx

Upvotes: 7

Related Questions