Git diff --numstat with --name-status

Is there a way to get the result of the work git diff --numstatand git diff --name-statusin one start?

My problem is that if I use only --numstat, then I do not know if any new lines have been added to the file or if the file is completely new. When using, --name-statusI get information if the file is new or not, but there is no statistics on line changes.

My workaround is currently running both commands separately, and then merging this output with a PowerShell script, but since the repo is quite large, I would like to get the desired output first. Thanks in advance for your help!

+4
source share
3 answers

--numstat --summary;

git diff --numstat --summary

, "" ; , "git add" "git rm", git :

# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       new file:   b
#       deleted:    a

git diff --cached --numstat --summary

:

540  0   b
0    3   a
 create mode 100644 b
 delete mode 100644 a

: --numstat --summary git diff, git diff --cached, git show , , .

+3

:

git log --stat --summary

. .

enter image description here

0

--diff-filter=A, , --diff-filter=a, :

git diff --numstat --diff-filter=A
git diff --numstat --diff-filter=a
0

Source: https://habr.com/ru/post/1629141/


All Articles