DEV Community

Discussion on: 🙏 Please Add .gitattributes To Your Git Repository

Collapse
jcoelho profile image
JosĂ© Coelho • Edited on

I think that for the use case you presented the git core.autocrlf config option is more appropriate.
With this option each developer can work with their native eol character.

However what I like about your option is that you can commit the gitattribute file and force the change for every developers

Collapse
deadlybyte profile image
Carl Saunders Author

Thanks for the tip.

Collapse
andreidascalu profile image
Andrei Dascalu

You're not really forcing it if you need to ask everyone to flush their cache / reset gitattributes.
If you need cooperation, it's better to just ask developers to set their autocrlf setting properly.
Prettier issue aside, it's better to preempt accidental commits of eol changes anyway.