Consistent line endings
Block two specific line-ending hazards:
-
Mixed CRLF + LF in the same file. Almost always a Windows / Unix tool mixing on the same file. Diffs become noise; some parsers (notably make + bash + Python triple-quoted strings) handle it silently wrong.
-
Unix shebang + CRLF anywhere in the file.
#!/bin/bash\ris the canonical “this script will not run” footgun - the kernel tries to invoke/bin/bash\ras the interpreter and printsbad interpreter: no such file or directory.
Windows-script extensions (.bat, .cmd, .ps1) and CRLF-required
formats are exempt.
Fix#
Normalize to LF:
dos2unix <file>
or with sed:
sed -i 's/\r$//' <file>
Lock the convention in .gitattributes:
* text=auto eol=lf
BLOCK rejects the push. Turn frames on per repo on the dashboard's Policy page - see choosing what the gate checks.
Source on GitHub Live demo How it works Questions: contact@nimblegate.com