-1

I am using Git, IntelliJ and Azure. When I push my work and make a PR, I have more than a thousand files showing white spaces differences. This is very inconvenient. Have you ever come across this problem? How can I solve it?enter image description here

blueberry
  • 61
  • 7
  • 1
    https://stackoverflow.com/a/13794684/542251 – Liam May 11 '21 at 13:45
  • Does this answer your question? [Make git undo any whitespace-only changes?](https://stackoverflow.com/questions/13793241/make-git-undo-any-whitespace-only-changes) – Liam May 11 '21 at 13:45
  • so the only way to resolve this problem is with git? it's to write a git commands every single time? – blueberry May 11 '21 at 15:00
  • No, you just need to change your git cinfig. Read the question – Liam May 12 '21 at 07:27

1 Answers1

0

The thing is : if white space differences landed in Azure, this means they were in your local files when you committed in the first place.

Check on your local repo what these "whitespace only" changes are : you will simply need to use a diff viewer which is able to display whitespaces -- although I couldn't tell you where to look, I'm 100% sure that IntelliJ has a setting somewhere to display explicitly whitespaces and line endings in a file or a diff view.


A common issue on Windows : depending on your local git configuration, line endings can get changed between cr lf and lf.

The main configuration parameter is git config core.autocrlf, see for example this question for more details :
Why should I use core.autocrlf=true in Git?

Check what your central repo expects, and how your workstation is configured.

LeGEC
  • 46,477
  • 5
  • 57
  • 104