Reputation: 4356
How do I change the line endings of all source files in an existing project in Visual Studio 2017 for Mac?
I have cloned a Git project where a few of the files have mixed line endings. The vast majority of the source files use Unix line endings (\n
). I used a regex search and replace to find all \u2028
(LINE SEPARATOR) characters and replace them with \n
, but I'm wondering if there's a way to normalise the line endings in a simpler way.
The problem these supported but non-standard line endings have is that Git doesn't recognise them, causing multiple lines to be marked as changed, when only a single line has really been changed.
I have seen some line ending answers for the Windows version of Visual Studio 2017, but the Mac version is quite different, so the answers weren't applicable.
Upvotes: 3
Views: 7131
Reputation: 6617
You can change how you save individual files in Visual Studio for Mac
Leave line endings as is
to Always convert line endings
.Upvotes: 6