To change the new line character for "New text file line delimiter" one would go to
Window -> Preferences -> General
Then change the "New text file line delimeter" to Windows, Unix or Max OS9.
I would like to know how to change the default line delimiter when editing existing files.
My co-worker uses a Mac and commits a Java class. I then check it out and add more code. When I do a "git diff" my changes have meta-characters (^M). I presume they are carriage-return characters.
What setting can I use in Eclipse to always use Unix style new line characters not just for new text files?
To convert the file that's open/exists:
File -> Convert Line Delimiters To -> Unix
Try Preferences->General->Workspace.
Set Text file encoding to UTF-8. Set line delimiter to Unix.
You could also configure GIT to not show the carriage return characters when doing a diff.
Add whitespace = cr-at-eol under the core section.
This article explains how to configure GIT for checking out, committing and Windows/Unix styles.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With