Fix git error "fatal: CRLF would be replaced by LF in FILE"

July 16, 2022

Error:

git add --all
fatal: CRLF would be replaced by LF in src/main.c

Fix:

  1. Remove CR symbol from CRLF
find ./src/*.c -exec sed -i 's/\r$//' {} +

Source: StackOverflow