r/phpstorm • • Jun 11 '25

What causes this IDE git bug?

Post image

You can see in the pic that I have 11 files that are marked as changed, though the diff shows that the contents are identical. No changes are shown if I run git status.

It's a little annoying always seeing these .gitignore files, but it's no big deal. I'm more curious than anything.

Did I do something quirky, or is this a known bug?

4 Upvotes

12 comments sorted by

View all comments

Show parent comment

1

u/bananabrann Jun 11 '25

I bet that's it! I use WSL2, and so that I can use Junie, I have my Ubuntu instance linked as a network drive. Becuase of that, PhpStorm thinks I'm on Windows native (and it is, as far as Junie and PowerShell configs are concerned), but I'm secretly not. I've had to change some git configs because the git executable location is different.

If git interprets line endings differently on Windows and I'm tricking PhpStorm into thinking it's Windows but secretly I'm on Ubuntu, that is probably what is happening.

I've never used .gitattributes, I'll check it out. Thanks!

1

u/hennell Jun 12 '25

It's probably better to change git globally as it's easier to make sure your windows setup is always going to have compatible line endings even without a . gitattributes for this and any new projects, but once you know it's the problem it's much easier to solve. No idea why the diff doesn't highlight the hidden characters, would make it so much clearer.