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

后端 未结 3 707
佛祖请我去吃肉
佛祖请我去吃肉 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:24

    Use aha. You can install it in ubuntu with sudo apt-get install aha. Also see https://github.com/theZiz/aha.

    $ git diff --color-words | aha > index.html
    $ firefox index.html
    

    Firefox should then be able to print it in color. Check out aha --help for some other cool options.

提交回复
热议问题