Skip to content

Add .gitattributes to enforce LF line endings#125

Merged
Alan-Jowett merged 2 commits intomainfrom
copilot/add-gitattributes-to-enforce-lf-line-endings
Mar 30, 2026
Merged

Add .gitattributes to enforce LF line endings#125
Alan-Jowett merged 2 commits intomainfrom
copilot/add-gitattributes-to-enforce-lf-line-endings

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 30, 2026

Without a .gitattributes file, line endings depend on each contributor's local core.autocrlf setting, causing CRLF to appear in committed Markdown/YAML files from Windows contributors and producing noisy diffs.

Changes

  • .gitattributes — Added at repo root with:
    • * text=auto eol=lf — auto-detects text vs. binary and enforces LF storage for all text files
    • Explicit text eol=lf rules for .md, .yaml, .yml, .json, .py as a safety net for known text types
# Normalize all text files to LF
* text=auto eol=lf

# Explicitly mark file types
*.md text eol=lf
*.yaml text eol=lf
*.yml text eol=lf
*.json text eol=lf
*.py text eol=lf

Ran git add --renormalize . after adding the file — all existing files already use LF, so no content changes result from renormalization.

Copilot AI changed the title [WIP] Add .gitattributes to enforce LF line endings for Markdown and source files Add .gitattributes to enforce LF line endings Mar 30, 2026
Copilot AI requested a review from abeltrano March 30, 2026 14:07
@abeltrano abeltrano marked this pull request as ready for review March 30, 2026 15:25
Copilot AI review requested due to automatic review settings March 30, 2026 15:25
@Alan-Jowett Alan-Jowett merged commit cc549d5 into main Mar 30, 2026
4 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a repository-wide .gitattributes to normalize text files to LF, reducing noisy diffs caused by contributors committing CRLF line endings from Windows setups.

Changes:

  • Introduces .gitattributes at the repo root to enforce LF for text files.
  • Adds explicit LF rules for common file extensions as a safety net.

@Alan-Jowett Alan-Jowett deleted the copilot/add-gitattributes-to-enforce-lf-line-endings branch March 30, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add .gitattributes to enforce LF line endings for Markdown and source files

4 participants