Thread (1 message) 1 message, 1 author, 2017-08-22

Re: Cannot checkout after setting the eol attribute

From: Junio C Hamano <hidden>
Date: 2017-08-22 20:03:44

Torsten Bögershausen [off-list ref] 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help