PHPStorm同步如何忽略行分隔符?

If I run a sync with a server I get changes in all files because of different line separators. All files show no changes but a hint: "contents have differences only in line separators".

Can I make PHPStorm ignore those line separators?

The best solution is to change your default line separator style to use the same as your server. To do that, open File -> Settings -> Editor -> Code Style and set the "Line Separator" option to the same option as on your server.

Another solution is to deactivate the "Inconsistent line separators" inspection in your inspections settings (File -> Settings -> Editor -> Inspections -> Portability issues -> Inconsistent line separators).

Can I make PHPStorm ignore those line separators?

There is no such option.

Thing is: there is no difference in actual content (code), but the difference is still there in line endings, which is still part of the "content".

https://youtrack.jetbrains.com/issue/IDEA-101502 -- star/vote/comment to get notified on progress.


I may only suggest to convert all of your local files to the same line endings (Unix - LF) -- PHP on Windows sees no difference between them when executing.

Settings | Editor | Code Style --> Line Separator -- affects newly created files.

For existing files you have to perform such conversion manually: select files/folders (or whole project) in Project View panel and use correct entry from File | Line Separators.