How to avoid whitespace being commit with github

前端 未结 3 1635
梦毁少年i
梦毁少年i 2021-02-04 21:10

I made a 2 lines of change but in git It shows more lines of changes because of whitespace. Its very difficult for us to review the exact code changes.

The below are the

3条回答
  •  广开言路
    2021-02-04 21:38

    You can use git diff -w | git apply --cached --ignore-whitespace as mentioned here

    EDIT: After you make any change, run
    git diff -w | git apply --cached --ignore-whitespace
    then
    git commit -m "your message"

提交回复
热议问题