How to get diff
for specified user between two dates from git? Or, how to use git whatchanged
command to list commits for specified user?
Is there any none-scripting way (builtin git command)?
To see the changes between two commits, you can use git diff ID1.. ID2 , where ID1 and ID2 identify the two commits you're interested in, and the connector .. is a pair of dots. For example, git diff abc123.. def456 shows the differences between the commits abc123 and def456 , while git diff HEAD~1..
The git diff command returns a list of all the changes in all the files between our last commit and our current repository. If you want to retrieve the changes made to a specific file in a repository, you can specify that file as a third parameter.
In most cases, Git picks A and B in such a way that you can think of A/- as "old" content and B/+ as "new" content. Let's look at our example: Change #1 contains two lines prepended with a "+". Since no counterpart in A existed for these lines (no lines with "-"), this means that these lines were added.
The git diff command is a widely used tool to track the changes. The git diff command allows us to compare different versions of branches and repository. To get the difference between branches, run the git diff command as follows: $ git diff <branch 1> < branch 2>
I believe there's no such a way to get a diff only knowing dates.
As of today you can do the following:
git log --since "OCT 4 2011" --until "OCT 11 2011" --pretty=format:"%H"
And then git diff
between first and last revisions. If the revision list is far too long, use the above git log ...
with | head -1
and | tail -1
to get the first and the last revisions.
Note that the above git log will return revisions exactly between given dates, i.e. revisions for OCT 5, OCT 6, ..., OCT 10.
This is possible, and with the user / committer criteria:
git log --after="2015-10-14" --before="2015-10-21" --grep="MB[FT][0-9-]*" --author="John\|Mary"
This will match anything
John
or Mary
MBT
or MBF
plus a number-code that can include a -
char.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With