How to wrap git commit comments?

后端 未结 15 1954
野性不改
野性不改 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:26

    Mentioned in the previous answer is that the default pager (often 'less') is responsible for wrapping and by default it generally chops long lines.

    To modify this without changing your commit messages (less and bash example):

    $ echo $LESS
    -FRSX
    

    This was what I had by default, now to overwrite the LESS environment variable.

    echo "LESS=-FRX;export LESS" >> ~/.bash_profile
    source ~/.bash_profile
    

提交回复
热议问题