Add default .gitattributes
Why add a default .gitattributes file? I've customer that use the dx-empty repository - as if it's some for of best practice for salesforce (which you never claim). Adminveloper and more already have many difficulties to understand what's going on. Having a default git attribute would help them with the hussles they are facing.
Adding a .gitattributes file with sensible defaults ensures consistent behavior across different operating systems and developer environments. Without it, Git relies on each contributor’s local configuration (e.g., core.autocrlf), which can lead to line ending inconsistencies, merge conflicts, and unnecessary diffs.
Benefits of this configuration Cross-platform consistency
- Setting
* text eol=autoensures text files use the correct line endings for the contributor’s platform while maintaining a consistent representation in the repository. This prevents Windows vs. Unix line ending issues from showing up as spurious changes.
Binary file integrity
- Marking
*.asset binaryensures that binary files are never modified by Git’s line ending normalization. This protects against corruption and unnecessary diffs.
Proposed Default
# Set the default line return behavior, in case people don't have core.autocrlf set.
* text eol=auto
# Prevent Git from altering binary asset files
*.asset binary
assisted by ai, checked for correctness