Using git diff, how can I get added and modified lines numbers?

前端 未结 12 2054
清酒与你
清酒与你 2020-11-30 22:13

Assuming I have a text file

alex
bob
matrix
will be removed
git repo

and I have updated it to be

alex
new line here
another         


        
12条回答
  •  猫巷女王i
    2020-11-30 22:52

    You can use git diff coupled with shortstat parameter to just show the no of lines changed.

    For the no of lines changed (in a file that's already in the repo) since your last commit

    git diff HEAD --shortstat
    

    It'll output something similar to

    1 file changed, 4 insertions(+)
    

提交回复
热议问题