I'm working with large codebase (40GB repo) and I cant afford to switch branches and checkout other branch because their external dependency system will clear current setup (and it is a nightmare to redownload trillion of GB of data every time) yet somehow, I need to find out the following:
- find all changes in
Source/Some/Custom/Dir
- ideally, for just
*.cs
files - starting from July 3 2022 up to September 1 2022
- in (remote) branch
origin/extra_branch
(different from my current) - display it as commit history with comments and files changed or/and changes itself
CodePudding user response:
You can use
git log --name-status --since=2022-07-03 --until=2022-09-01 origin/extra_branch -- 'Source/Some/Custom/Dir/**.cs'
Some notes:
--since
and--until
inspect the committer date, not the author date. This means, for example, if the branch was rebased recently (after 2022-09-01), then none of the rebased commits would be listed because the committer date is later than 2022-09-01.- Replace
--name-status
with other options that control the output, e.g.,--stat
,--patch
,--name-only
. - The double-asterisk in
.../**.cs
ensures that paths are inspected in lower directories recursively. - As usual, the provided pathspec ensures that only commits are found that make changes to these paths. Additionally, only these paths are listed. To get the complete change in the commit, add
--full-diff
.