I use multiple environments thanks to virtual machines, and my code directory is shared between them. I also like my code to have the native (host) line endings.
When I'm on a Windows host, I checkout my code and line endings are converted to \r\n
(and it's OK for me). But when I want to execute a shell script from my Linux virtual machine, I get errors telling me the /bin/sh^M
doesn't exist.
Can I tell Git to keep Unix endings for this specific file? Is there a better way to deal with line endings on multiple environments?