Closed hansmbakker closed 5 months ago
I think the solution for this is setting your Git config setting core.autocrlf
to either auto
or input
(I personally use auto, also windows user) https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings
I feel like adding gitattributes is a bit overkill since imo windows and posix users working together isn't really a repository-specific thing but rather a more broad issue which is why I think it's better solved by changing your global git config
I feel like adding gitattributes is a bit overkill
I think having gitattributes is still a helpful thing to have - to ensure files are handled correctly? (I noticed this repo was missing one, and added one that felt like made sense for this repo)
I prefer not to use autocrlf - some files like sh
files should always be lf
, and some (windows-specific) files should always be crlf
.
Hi, I am having issues with source formatting and line endings. I am using Windows.
I tried adding https://github.com/gitattributes/gitattributes/blob/master/Web.gitattributes to ensure consistent file handling across platforms (see https://github.com/amzn/style-dictionary/pull/1162/commits/908c413d6a4285f9c766590fdb15bcc522aaf21a) but every time I try to commit it detects wrong formatting (incorrectly). When I run
npm run format
, it generates a lot of changed files, which disappear when I stage them.