I develop for both Windows and linux. My Linux development environment is a virtual box running on my windows hosts. i have some directories shared (actually suing samba, not the built-in virtual box shared folders, so the directory is actually on the linux guest and shared up to the host)
We are moving from svn to git. I want to run Source Tree on my windows machine (the linux is headless) to do the version control. But I want all the files to have linux line endings (LF).
I tried following the instructions at Force LF eol in git repo and working copy but they aren't working for me.
I have set the config as follows:
[adamc@adamc-centos scripts]$ git config core.autocrlf
input
[adamc@adamc-centos scripts]$ git config core.eol
lf
I have the following in my .gitattributes (even forced .sh to be text fioles and specified the eol again)
* text=auto
*.sh text eol=lf
I have run the checkout-index command specified there, and I still have .sh files with windows line endings!
[adamc@adamc-centos scripts]$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
[adamc@adamc-centos scripts]$ git checkout-index --force --all
[adamc@adamc-centos scripts]$ ./EWEB/get_unmerged.sh
-bash: ./EWEB/get_unmerged.sh: /bin/bash^M: bad interpreter: No such file or directory
What have I missed? Or am I approaching it wrong?
core.eol
is ignored if you setcore.autocrlf
totrue
orinput
git-scm.com/docs/git-config#Documentation/… – Holsworth