Pushing to github messes up my code indentation


I primarily use Netbeans to write PHP code and as an example you can see in this example that my code indentation is horrendous. Pulling this code or push to the code doe not reflect the indentation issues seen here.

That is to say: I can push that the indentation shown in the example are not shown or reflected in the editor and the same goes for pulling.

I have my tabs set to 4 spaces in netbeans, whats going on? how can I fix this? This reflects poorly on me as a developer.


Try this

Visual Studio Code:

  • Open command palette [ctrl + shift + p] > type and select "Convert
    indentation to spaces

Sublime Text:

  • Open command palette [ctrl + shift + p] > type and select "convert to space"


Answered By – MohitGhodasara

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published