How do I prettily print out a git-diff output?

后端 未结 3 719
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-18 19:52

for my upcoming Bachelor thesis, I am required to print out the git-diff output for the appendix of the paper. I really like the output of git diff --color-words, b

3条回答
  •  太阳男子
    2021-02-18 20:17

    I just tried an npm package hosted on Github: pretty-diff

    You install it via npm and run it as you would with git-diff, for example:

    pretty-diff HEAD^
    

    A new browser window opens and you can save it as html. I've tried to open it again in a different browser and colors are still showing. You can also use your github account to create gists and share them.

提交回复
热议问题