\n,Unix/macOS)、CRLF(\r\n,Windows)、CR(\r,旧 Mac)。\n 字符串。core.autocrlf 或 .gitattributes 规范行尾。^M 错误。Convert line endings between CRLF and LF, and see how many lines each file style affects.
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Line endings | LF=0A Unix, CRLF=0D0A Windows, CR=0D legacy Mac | POSIX / ISO 6429 |
| Network text | HTTP headers and bodies delimit lines with CRLF | RFC 9110 Section 5 |
| Text mode rule | store LF in VCS; convert on checkout per platform | Git core.autocrlf semantics |