Git diff to show only lines that have been modified

前端 未结 7 1285
北恋
北恋 2020-12-04 08:10

When I do a git diff, it shows lines that have been added:

+ this line is added

lines that have been removed:

- this line i         


        
7条回答
  •  时光说笑
    2020-12-04 08:48

    What you want is a diff with 0 lines of context. You can generate this with:

    git diff --unified=0
    

    or

    git diff -U0
    

    You can also set this as a config option for that repository:

    git config diff.context 0
    

    To have it set globally, for any repository:

     git config --global diff.context 0
    

提交回复
热议问题