Someone in our development team merged in code but with windows newline characters. And git, merging tool get crazy about it. How is it possible to replace all 0D0A
-> 0A
in the whole Xcode project? If I do it in Xcode, Xcode crashed.
Asked
Active
Viewed 254 times
-1

János
- 32,867
- 38
- 193
- 353
-
How are you doing it in xCode and which xCode version do you have? – little Apr 10 '18 at 10:39
-
Version 9.3 (9E145) – János Apr 10 '18 at 10:52
-
Did you try this http://www.perlmonks.org/?node_id=258025 ? – Martin R Apr 10 '18 at 11:17
-
You could use the `dos2unix` tool – ikegami Apr 10 '18 at 12:28
-
FYI - there is some help regarding this on github, which refreshes line endings on your repository (without the need for perl): https://docs.github.com/en/free-pro-team@latest/github/using-git/configuring-git-to-handle-line-endings#refreshing-a-repository-after-changing-line-endings – 0909EM Oct 07 '20 at 23:33
1 Answers
0
This worked:
perl -pi -w -e 's/\r\n/\n/g;' *.h
perl -pi -w -e 's/\r\n/\n/g;' *.m

János
- 32,867
- 38
- 193
- 353