Skip to content

Normalize line endings#24

Merged
alexdima merged 2 commits intomicrosoft:masterfrom
SamB:normalize-line-endings
Aug 13, 2019
Merged

Normalize line endings#24
alexdima merged 2 commits intomicrosoft:masterfrom
SamB:normalize-line-endings

Conversation

@SamB
Copy link
Contributor

@SamB SamB 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 August 6, 2019 13:31
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.
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
```
@alexdima
Copy link
Member

Thank you!

@alexdima alexdima merged commit 4c69904 into microsoft:master Aug 13, 2019
@alexdima alexdima 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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants