How To Fix GitHub’s Weird Issue With Wrong Indentation

Switch from tabs to spaces

github indentation wrong
Source: the author

You might know the pain with an indentation on GitHub like in the above picture. In your editor, your code looks great. Then you push it to a GitHub repo, and suddenly, the indentation is messed up.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Louis Petrik

Louis Petrik

2.9K Followers

Programming, Finance & Psychology. Figuring out life, one idea at a time.