Home:ALL Converter>Git show files that were changed in the last 2 days

Git show files that were changed in the last 2 days

Ask Time:2011-09-21T20:44:24         Author:dole doug

Json Formatter

How can I have a list with all the files that were changed in the last 2 days? I know about

git log --name-status --since="2 days ago" 

but this will show me ids, dates and commit messages. All I need is the list of the file names which were changed.

Is that possible with git?

Author:dole doug,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/7499938/git-show-files-that-were-changed-in-the-last-2-days
Adam Dymitruk :

You can do a diff of a version that's closest to 2 days ago with:\n\ngit diff $(git log -1 --before=\"2 days ago\" --format=%H).. --stat\n\n--stat gives you a summary of changes. Add --name-only to exclude any meta information and have only a file name listing.\n\nHope this helps.",
2011-09-21T18:02:49
Peng Qi :

git log --pretty=format: --name-only --since=\"2 days ago\"\n\n\nif some files duplicate in multiple commits, you can use pipe to filter it\n\ngit log --pretty=format: --name-only --since=\"2 days ago\" | sort | uniq\n",
2011-09-21T13:07:51
AA. :

git diff --stat @{2.days.ago} # Deprecated!, see below\n\nShort and effective\nEdit\nTLDR: use git diff $(git log -1 --before=@{2.days.ago} --format=%H) --stat\nLong explanation: The original solution was good, but it had a little glitch, it was limited to the reflog, in other words, only shows the local history, because reflog is never pushed to remote. This is the reason why you get the warning: Log for 'master' only goes back to... in repos recently cloned.\nI have configured this alias in my machine:\nalias glasthour='git diff $(git log -1 --before=@{last.hour} --format=%H) --stat' \nalias glastblock='git diff $(git log -1 --before=@{4.hours.ago} --format=%H) --stat' \nalias glastday='git diff $(git log -1 --before=@{last.day} --format=%H) --stat' \nalias glastweek='git diff $(git log -1 --before=@{last.week} --format=%H) --shortstat | uniq' \nalias glastmonth='git diff $(git log -1 --before=@{last.month} --format=%H) --shortstat | uniq' \n\ncredits: answer below by @adam-dymitruk",
2013-11-24T04:15:24
holygeek :

Use the --raw option to git log:\n\n$ git log --raw --since=2.days\n\n\nSee the --diff-filter part of the git log help page for the explanation of the flags shown in the --raw format. They explain what happen to the files in each commit:\n\n --diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]\n Select only files that are Added (A), Copied (C), Deleted (D),\n Modified (M), Renamed (R), have their type (i.e. regular file,\n symlink, submodule, ...) changed (T), are Unmerged (U), are Unknown\n (X), or have had their pairing Broken (B). Any combination of the\n filter characters (including none) can be used. When *\n (All-or-none) is added to the combination, all paths are selected\n if there is any file that matches other criteria in the comparison;\n if there is no file that matches other criteria, nothing is\n selected. \n",
2011-09-21T13:43:44
yy