Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize line endings #24

merged 2 commits into from Aug 13, 2019


Copy link

commented Aug 6, 2019

Changes to make things safe for people who have core.autocrlf=true in their git settings, which is basically the default on Windows.

Unfortunately, this requires changes on (virtually) every line of files that use CRLF line terminators, so it' would be best to review this as quickly as possible so that I don't have to fix the merge conflicts too many times.

The git log -p --ignore-cr-at-eol command is useful for verifying that I haven't accidentally changed anything besides CRs at the ends of lines (as would happen if, for example, I had chosen the wrong merge resolution when rebasing these changes on top of any new commits).

(The --ignore-cr-at-eol flag is one of the diff-options, so you can use it with most of git's other diff-generating commands, too.)

SamB added 2 commits Aug 2, 2019
Avoid (some) line-ending issues on Windows
The following is basically the default on Windows:

$ git config --global core.autocrlf true

In this configuration, git gets *very* confused if there are files
with CRLF terminators in the repository, so it's best to avoid having
such files.

Let's configure Git to avoid adding any more such files.
Normalize line-endings
As hinted at in the end of the preceding commit message, "to avoid
adding any more such files", there were already some files with CRLF
line terminators in the repository.

This commit removes them, thanks to the command:

$ git add --renormalize -u

This comment has been minimized.

Copy link

commented Aug 13, 2019

Thank you!

@alexandrudima alexandrudima merged commit 4c69904 into microsoft:master Aug 13, 2019

1 check passed

license/cla All CLA requirements met.

@alexandrudima alexandrudima added this to the August 2019 milestone Sep 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.