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?
Short and effective
Edit
TLDR: use
git diff $(git log -1 --before=@{2.days.ago} --format=%H) --stat
Long 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, becausereflog
is never pushed to remote. This is the reason why you get thewarning: Log for 'master' only goes back to...
in repos recently cloned.I have configured this alias in my machine:
credits: answer below by @adam-dymitruk
if some files duplicate in multiple commits, you can use pipe to filter it
You can do a diff of a version that's closest to 2 days ago with:
git diff $(git log -1 --before="2 days ago" --format=%H).. --stat
--stat
gives you a summary of changes. Add--name-only
to exclude any meta information and have only a file name listing.Hope this helps.
Use the --raw option to git log:
See 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: