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

前端 未结 12 2027
清酒与你
清酒与你 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:38

    Configure an external diff tool which will show you the line numbers. For example, this is what I have in my git global config:

    diff.guitool=kdiff3
    difftool.kdiff3.path=c:/Program Files (x86)/KDiff3/kdiff3.exe
    difftool.kdiff3.cmd="c:/Program Files (x86)/KDiff3/kdiff3.exe" "$LOCAL" "$REMOTE"
    

    See this answer for more details: https://stackoverflow.com/q/949242/526535

提交回复
热议问题