Comprehensive guide to Git line ending configuration for cross-platform development teams. Use when configuring line endings, setting up .gitattributes, troubleshooting line ending issues, understanding core.autocrlf/core.eol/core.safecrlf, working with Git LFS, normalizing line endings in repositories, or resolving cross-platform line ending conflicts. Covers Windows, macOS, Linux, and WSL. Includes decision trees, workflows, best practices, and real-world scenarios.
View on GitHubmelodic-software/claude-code-plugins
git
January 21, 2026
Select agents to install to:
npx add-skill https://github.com/melodic-software/claude-code-plugins/blob/main/plugins/git/skills/line-endings/SKILL.md -a claude-code --skill line-endingsInstallation paths:
.claude/skills/line-endings/# Git Line Endings Comprehensive guide to Git line ending configuration for cross-platform development teams. ## When to Use This Skill Use this skill when: - **Line Endings tasks** - Working on comprehensive guide to git line ending configuration for cross-platform development teams. use when configuring line endings, setting up .gitattributes, troubleshooting line ending issues, understanding core.autocrlf/core.eol/core.safecrlf, working with git lfs, normalizing line endings in repositories, or resolving cross-platform line ending conflicts. covers windows, macos, linux, and wsl. includes decision trees, workflows, best practices, and real-world scenarios - **Planning or design** - Need guidance on Line Endings approaches - **Best practices** - Want to follow established patterns and standards **Last Verified:** 2025-11-25 **Last Audited:** 2025-11-25 (Comprehensive Type A audit - 79/80 score, content validated via MCP servers against official Git documentation) ## Overview ### What Are Line Endings? Line endings are invisible characters that mark the end of a line in text files: - **LF (Line Feed)**: `\n` - Used by Unix, Linux, macOS (1 byte) - **CRLF (Carriage Return + Line Feed)**: `\r\n` - Used by Windows (2 bytes) - **CR (Carriage Return)**: `\r` - Legacy Mac OS 9 and earlier (rarely seen today) ### Why Line Endings Matter **The Problem:** ```bash # Windows developer creates file with CRLF echo "#!/bin/bash" > script.sh # Linux developer pulls and tries to run it ./script.sh # Error: /bin/bash^M: bad interpreter: No such file or directory ``` **Common Issues:** 1. Shell scripts fail to execute (Unix requires LF, CRLF breaks shebang lines) 2. Massive diffs (every line shows as changed when only line endings differ) 3. File corruption (binary files treated as text get line endings mangled) 4. Build failures (Makefiles, configuration files may require specific endings) 5. Git conflicts (line ending differences cause merge conflicts) ### How Git