Deploy changing newlines on external server

When I do a Ctrl+S (deploy to server), git keeps reporting that the entire file was changed, and I think PHPStorm is changing the line endings though I'm not seeing how to fix it. It's only happening on certain files which I think were saved with different line endings from other developers, but the problem is only happening from my PHPStorm deploy.

By the way, I've already troubleshot git, tried `git config --global core.autocrlf true` etc. If it helps, we're using Windows computers going to a Linux server, though previous developers would save willy-nilly the line endings however their software saved it directly to the server (they didn't use git or PHPStorm).

4 comments
Avatar
Vladimir Luchansky
Comment actions Permalink

Hello,

PhpStorm can change only local files line separators according to File | Settings | Editor | Code Style settings.

Were any specific changes introduced to these certain files? Like case-only renaming?

0
Comment actions Permalink

Which setting? There's nothing in there about changing the line-ending type (LF/CR/CRLF), which is what's happening when it deploys to the server (git shows all lines are changes, and other editors only say the line endings are different).

0
Avatar
Vladimir Luchansky
Comment actions Permalink

> Which setting?

File | Settings | Editor | Code Style > Line Separator

> git shows all lines are changes

This looks more like a Git routine. Did you try to save and upload these certain files manually via another software?

0
Comment actions Permalink

My Line Separator setting is "System-Dependent"; again I'm on a Windows computer deploying to a Linux server through PHPStorm. Doesn't "System-Dependent" auto-save the file locally from my PHPStorm with CRLF (Windows)? Does that mean the Deploy will copy the file directly to the Linux server or write the file there with LF? I can find a way to check whether the Linux file is using LF or not (unless you recommend something).

I'm not sure what you mean by a Git routine. Like I've been saying, I'm deploying the file from PHPStorm (Ctrl+S Eclipse-style, or right-click manual upload), nothing else.

0

Please sign in to leave a comment.