Git diff with line numbers (Git log with line numbers)

后端 未结 9 856
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 18:57

When I do a git diff or a git log -p, how do I get line numbers of the source file(s) inlined with the output?

I tried to look it up

9条回答
  •  一整个雨季
    2020-11-29 19:29

    I like to use git difftool with meld as my difftool. It's easier to look at than git diff, has a nice side-by-side gui comparison, and shows line numbers on each side.

    Setup:

    1. Instructions on how to set up meld as your difftool for Windows or Linux

    Sample Screenshot:

    Update 24 May 2020:

    I just wrote git diffn over the last few days to be a drop-in replacement for git diff on the command-line. Give it a shot. See my other answer here.

提交回复
热议问题