Git on Windows by default is a bit too clever for itself with line endings, typically having the config autocrlf=true
When I checkout a Linux/OSX repo that contains shell scripts that are used in a built Docker image - please leave line endings as LF as per the repo - don't convert to CRLF.
To achieve this for the entire repo, git clone like so:
git clone --config core.autocrlf=input <repo>
More info: https://git-scm.com/docs/git-config#git-config-coreautocrlf