git: list all files added/modified on a day (or week/month...)

GitGit Log

Git Problem Overview


Given a period of time (e.g. a day, a week, a month), is it possible to list all files that were modified or added in this time?

Git Solutions


Solution 1 - Git

I'd use diff to yield the file list directly, e.g:

git diff --name-only "@{3 days ago}" "@{2 days ago}"

changelog.txt
newfile.txt

In case you're curious which file got modified or added, use --name-status instead:

git diff --name-status "@{3 days ago}" "@{2 days ago}"

M       changelog.txt
A       newfile.txt

Solution 2 - Git

Maybe this:

  git log --since="1 day ago" --name-only --pretty=format: | sort | uniq

Include --until if you want for a day, week etc.

Solution 3 - Git

I use this to get a clean list:

git whatchanged --since '04/14/2013' --until '05/22/2014' --oneline --name-only --pretty=format: | sort | uniq >> changedlist.txt

Solution 4 - Git

Git whatchanged should give you what you want, listing what files were modified.

Here's an example using Git source:

$ git --version
git version 1.7.8.rc0.35.gee6df
$ git whatchanged --since '10/27/2011' --until '10/30/2011' --oneline
55e7c0a (squash) test for previous
:100755 100755 dbf623b... 53905a2... M  t/t8006-blame-textconv.sh
2564aa4 blame.c: Properly initialize strbuf after calling, textconv_object()
:100644 100644 173f286... e39d986... M  builtin/blame.c
e8e1c29 Update draft release notes to 1.7.8
:100644 100644 3045245... ddb8d37... M  Documentation/RelNotes/1.7.8.txt
8debf69 clone: Quote user supplied path in a single quote pair
:100644 100644 488f48e... efe8b6c... M  builtin/clone.c

Solution 5 - Git

Here is one more without empty lines:

git log --after="2015-11-05T16:36:00-02:00" --before="2015-11-15T16:36:00-02:00" --pretty=format:"" --name-only | sed '/^\s*$/d' | sort | uniq -u

Solution 6 - Git

Try:

git log --since="2 days ago" --until="1 days ago"

If you omit --until you will get logs for last two days. You can also spesify weeks, months etc. You can also use git diff with --since and --until parameters. Work a little bit on output formatting and you are done.

Solution 7 - Git

Git BASH Command

git whatchanged --since '11/24/2017' --until '11/29/2017' --oneline --name-only --pretty=format: | sort | uniq >> changedlist.txt

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionthiasView Question on Stackoverflow
Solution 1 - GitingerView Answer on Stackoverflow
Solution 2 - GitmanojldsView Answer on Stackoverflow
Solution 3 - GitanshumanView Answer on Stackoverflow
Solution 4 - GitDan CruzView Answer on Stackoverflow
Solution 5 - Gitmetal4peopleView Answer on Stackoverflow
Solution 6 - GityasarView Answer on Stackoverflow
Solution 7 - GitTamilselvan KView Answer on Stackoverflow