# ======================= File Handling ===========================
# Normalize all text files to use LF (Unix line endings)
* text=auto

# ==================== Line Ending Settings =======================
# Force Unix-style line endings for shell scripts and config files
*.sh eol=lf
*.yml eol=lf
*.yaml eol=lf
*.json eol=lf
*.md eol=lf

# Force Windows-style line endings for batch and Windows executables
*.bat eol=crlf
*.cmd eol=crlf

# =================== Binary Files ========================
# Treat the following file types as binary, no diff or merge
*.jpg binary
*.png binary
*.gif binary
*.pdf binary
*.doc binary
*.docx binary
*.ppt binary
*.pptx binary
*.xls binary
*.xlsx binary
*.zip binary
*.tar.gz binary
*.rar binary
*.mp4 binary
*.mp3 binary

# ===================== Merge Strategies =========================
# Use union strategy for JSON files, allowing both changes to merge
*.json merge=union

# Use custom merge driver for lock files (e.g., package managers)
package-lock.json merge=ours
yarn.lock merge=ours
composer.lock merge=ours

# ======================= Diff Settings ==========================
# Custom diff for Markdown files (treat as text)
*.md diff=markdown

# Ignore diffs for minified files, treat as binary
*.min.js binary
*.min.css binary

# ==================== Language-Specific Settings =================
# Python: Normalize line endings and ignore diffs for compiled Python files
*.py text eol=lf
*.pyc binary
*.pyo binary
*.pyd binary

# C/C++: Normalize line endings for source files
*.c text eol=lf
*.cpp text eol=lf
*.h text eol=lf
*.hpp text eol=lf

# ==================== Documentation Handling ====================
# Treat all documentation files as text with Unix line endings
*.txt text eol=lf
*.md text eol=lf
*.rst text eol=lf

# ==================== Font and Icon Files =======================
# Treat font and icon files as binary
*.ttf binary
*.woff binary
*.woff2 binary
*.svg binary

