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

前端 未结 12 2036
清酒与你
清酒与你 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条回答
  •  春和景丽
    2020-11-30 22:56

    Line numbers of all uncommitted lines (added/modified):

    git blame  | grep -n '^0\{8\} ' | cut -f1 -d:
    

    Example output:

    1
    2
    8
    12
    13
    14
    

提交回复
热议问题