How to get the same push output using date range in Git?

I like the way git shows how much code I pushed to the server [1] , is there any way to get this range of input dates or commit?

 [1]: 6 files changed, 575 insertions(+), 3 deletions(-) 
+4
source share
2 answers
 git push origin your_branch --verbose 

This should give you a hash range of output. Now you can do:

 git log sha1A..sha1B 

If you want to experiment with this first, add --dry-run to the click - the click will not happen.

But before you click, you can also try:

 git log origin/your_branch..your_branch 

This will show you what you click. If your_branch is already verified, you can simply release:

 git log origin/your_branch.. 

This will implicitly match the HEAD range that is your branch.

hope this helps.

+1
source

The main ways to get this kind of information are the options --shortstat , --stat and --numstat , which can be transferred to diffcore equipment, for example. via git-diff and git-log .

In your case, it seems that you want to use the --shortstat parameter, which gives only the final line, and not beautiful information for each file, as you see after the --stat specified by --stat . The latter, --numstat , provides the same file information in a more machine-readable format.

To apply this to the commit range, simply use git diff --shortstat AB , where A and B are the commits you want to compare.

To get the same information for every single commit in a range, and not all grouped together, use git log --shortstat A..B .

If you want to do this by date, you have a couple of options:

  • Specify one commit using the form <branch>@{<date>} . Keep in mind, however, that this gives the position of this branch at a given date. This is normal if it is a long-lived local branch, but if it did not already exist on that date or a remote branch that makes big jumps when retrieving, this may not be what you want.

  • Use the --since and --until for git log . This means that you will need to use two steps if you want a general summary - to determine the commits at each end of the range, and the other - to actually make diff.

See man gitrevisions more information on how to specify commits.

+2
source

All Articles