git - trim whitespace

前端 未结 4 722
南方客
南方客 2021-02-02 12:51

I\'ve accidentally put some whitespace in my initial commit - it shows up red in git diff --color. What\'s the best way to get rid of the existing whitespace and ho

4条回答
  •  被撕碎了的回忆
    2021-02-02 13:28

    And to trim the white spaces from all files recursively from all sub directories this can be used.

    find ./* -type f -exec sed -i 's/[[:space:]]*$//' {} \;
    

提交回复
热议问题