Fix Git Line Feeds on Windows Forever
In my day-to-day workflow, I frequently use a cygwin shell on Windows, namely Babun.
As you might imagine, shell scripts with Windows line endings \r\n are simply no good at all:
$ ./script.sh
bash: ./script.sh: /bin/sh^M: bad interpreter: No such file or directory
$ ./script.sh
./script.sh: line 2: $'\r': command not found
This blog post is a note to my future self to not read through the thousands of answers available on StackOverflow again.
Let’s get rid of those \r\n things.