marcelo2605
marcelo2605

Reputation: 2794

File appears as modified but has no change

If I open a random file on Sublime and just save it, without make any change, the file appears as modified on git.

Why this happens and how can I avoid this?

Upvotes: 0

Views: 148

Answers (2)

marcelo2605
marcelo2605

Reputation: 2794

I fix my problem editing my editor config file. Changing this line:

end_of_line = lf

by this:

end_of_line = crlf

And save all unchanged files again.

More info here: http://editorconfig.org/

Upvotes: 0

Claudio
Claudio

Reputation: 10947

Your editor has changed the Carriage Return (CR) or Line feed (LF) from one standard (e.g., Unix, Windows) to another. So the file has actually been changed, even if you can't see the change using a normal editor.

Upvotes: 1

Related Questions