Reputation: 340
I am not too much familiar with git commands. Is there a way to list only newly added or deleted files in git in last one week?
Upvotes: 2
Views: 285
Reputation: 45352
You can use --diff-filter
and show added files (A) & deleted files (D) between your working tree & a specific commit :
git diff --name-only --diff-filter=AD <commit sha>
You can also get the oldest commit sha since 7 days using :
git log --reverse --since=7.days --format="%H" | head -1
So you can endup with the following to list added & deleted files since 7 days :
git diff --name-only --diff-filter=AD $(git log --reverse --since=7.days --format="%H" | head -1)
Upvotes: 3