git remove trailing whitespace in new files before commit

前端 未结 4 1634
孤街浪徒
孤街浪徒 2020-12-05 03:10

I know removing trailing whitespace can be done with a pre-commit hook. I am interested in doing it manually. I read the question here:
Make git automatically remove tra

4条回答
  •  时光说笑
    2020-12-05 03:48

    If you use emacs, you can use "M^x delete-trailing-whitespace" to delete them before saving the file. (it can be customized in your .emacs also)

    vi seems to also allow this : http://vim.wikia.com/wiki/Remove_unwanted_spaces

提交回复
热议问题