Replace CRLF using powershell

This is a state-of-the-union answer as of Windows PowerShell v5.1 / PowerShell Core v6.2.0: Andrew Savinykh’s ill-fated answer, despite being the accepted one, is, as of this writing, fundamentally flawed (I do hope it gets fixed – there’s enough information in the comments – and in the edit history – to do so). Ansgar Wiecher’s … Read more

Is it possible for git-merge to ignore line-ending differences?

Update 2013: More recent git versions authorize using merge with strategy recursive and strategy option (-X): from “Git Merge and Fixing Mixed Spaces and Tabs with two Branches“: git merge -s recursive -Xignore-space-at-eol But using “-Xignore-space-change” is also a possibility Fab-V mentions below: git merge master -s recursive -X renormalize jakub.g also comments that the … Read more

Force LF eol in git repo and working copy

Without a bit of information about what files are in your repository (pure source code, images, executables, …), it’s a bit hard to answer the question 🙂 Beside this, I’ll consider that you’re willing to default to LF as line endings in your working directory because you’re willing to make sure that text files have … Read more

When do I use the PHP constant “PHP_EOL”?

Yes, PHP_EOL is ostensibly used to find the newline character in a cross-platform-compatible way, so it handles DOS/Unix issues. Note that PHP_EOL represents the endline character for the current system. For instance, it will not find a Windows endline when executed on a unix-like system.