Re: Cannot checkout after setting the eol attribute

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Torsten Bögershausen <tboegi@xxxxxx> writes:

> The following would solve your problem:
>    git init
>    echo $'dos\r' > dos
>    git add dos
>    git commit -m "dos newlines"
>    echo "dos -crlf" > .gitattributes
>    git add .gitattributes
>    git commit -m "add attributes"
>    echo "dos eol=crlf" > .gitattributes

>    git read-tree --empty   # Clean index, force re-scan of working directory
>    git add dos

This is not advisable as a general suggestion, as in a real life (as
opposed to a toy example) there will be paths other than this 'dos'
thing in the working tree.  Perhaps replace "git read-tree --empty"
with "git rm -f --cached dos" or something like that that limits its
damage would prevent mistakes better.

>    git add .gitattributes
>    git commit -m "set eol attribute instead"
>    git ls-files --eol




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux