Git stash: prevent converting line delimiters
In my regular repositories core.autocrlf=true
on Windows, I had a line-delimited file \n
(intentionally). After saving it as a stash and applying it later, it was changed to \r\n
, which was a bit unexpected for me.
How can I make stash save and apply not convert any line separator, but keep the files as they are?
source to share
You can use .gitattributes
or .git/info/attributes
to change CRLF handling for specific files. For example,
*.special text eol=lf
will always convert \n
to a Git repository. See man gitattributes for details .
source to share