How to wrap git commit comments?

后端 未结 15 1955
野性不改
野性不改 2020-12-01 01:01

Is there a way to wrap git commit comments (when viewed via git log), so they are not cut off at the end of the line? It seems like there should be a pretty sim

15条回答
  •  一生所求
    2020-12-01 01:14

    Or you can change your pager to use less -R

    $ git config --global core.pager 'less -R'
    

    This will tell less to stop trying to control how the screen is formatted (you can normally scroll right and left during a git log using arrow keys). And as the less manual says "Thus, various display problems may result, such as long lines being split in the wrong place." Which is what you want, you want the line ending to appear at the right of your screen (the wrong place) instead of where the comment author put it.

    Also to note, pressing the right arrow key without modifying your pager, will let you see more of the code. Which is my preferred method.

提交回复
热议问题