Search code examples
windowsgitgit-bashline-endings

How to clone github repo using unix type linefeeds


I'm trying to deploy the latest scrapinghub/splash

I am using git-bash on win10. I forked the repo to https://github.com/kc1/splash/blob/master

I've run into some problems in my original question (Docker: /bin/sh: 1: /tmp/provision.sh: not found)

Its been suggested that the problem is that the shell scripts have windows line endings (crlf) instead of the unix type (lf). I checked and indeed windows ending are being used in my cloned repo locally.

How can I clone the repo so that I get the unix type endings in my local windows environment?


Solution

  • git clone --config core.eol=lf <repository>
    

    Basically, you want to set this config param to control the line endings on your machine. The default of native will use whatever is native on your machine (which is crlf on windows). You can also set this in you global configs before doing the clone if you want it to apply to every repo

    git config --global core.eol lf