0

I use PhpStorm 2020.3.1 in my work and I encouneterd a problem when I work in a team and have to fix merge conflicts(I made git pull at first and apply updates manually ) and next I check my updates with command git diff I see that some automatic alignment is considered by git as my changes. I mean lines like :

  $var1 = ‘value1’;
  $varGte = ‘value2’;
  $var= ‘value’;

are rendered into :

  $var1   = ‘value1’;
  $varGte = ‘value2’;
  $var    = ‘value’;

And it is very strange that I work with many files, but I have such a problem only with 1 file. Are there some options ?
If there is a way remove such automatic alignment for all project or for 1 file?

Thanks!

mstdmstd
  • 2,195
  • 17
  • 63
  • 140
  • 1
    Does this answer your question? [How to make git diff --ignore-space-change the default](https://stackoverflow.com/questions/7310033/how-to-make-git-diff-ignore-space-change-the-default) – adampweb Mar 02 '21 at 08:02
  • Looks like not, as it inludes not only git diff command, but these spaces are considered as difference when I make pull request on bitbucket – mstdmstd Mar 02 '21 at 08:18
  • 2
    Open File | Settings | Editor | Code Style | PHP > "Wrapping and Braces" tab. Find "Array initializer" section at the bottom and remove "Align key-value pairs" checkbox. – Dmitrii Mar 02 '21 at 14:11
  • Wrapping and Braces - seems valid option. But can I set it for any project? No looks like it is common for all projects... – mstdmstd Mar 03 '21 at 12:05
  • 1
    @mstdmstd *"But can I set it for any project?"* Sure -- just use **Project Specific** coding style that is stored together with the project and not IDE-wide one. – LazyOne Mar 03 '21 at 19:17

0 Answers0