anonymous coward
anonymous coward

Reputation: 12824

I converted line endings, and git-diff says my whole file is different. What have I done?

Is this normal, and should I commit this?

I am aware that Git has settings to conver line-endings to \n before storing them, but reconfigured my editor to use *nix style by default (don't know how it changed to Windows style), and so I converted everything I had in my working directory, just to "get caught up".

Is there any reason to fear?

Not that it matters, but the files are CSS, HTML, PHP, JS, etc.

Upvotes: 0

Views: 256

Answers (1)

user229044
user229044

Reputation: 239521

Git is right. Git's diff's are based on whether a line has changed or not, and literally every single line in your file has changed. That's what happens when you convert line endings.

There's no reason for you to be worried about this, but you might consider the first option you mentioned - telling git to convert the files as they're committed, while leaving the copy in your working directory alone.

Upvotes: 3

Related Questions