Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with VSCode vs Github code indentation

I am currently having an issue with the automatic indentation when pushing my code to Github.

I currently have my tab settings to be using spaces on VS Code (tabs set to 2 spaces), yet Github is displaying a massive jump in the organization of the code.

Below are examples of what I am experiencing:

My code looks on VS Code: enter image description here

My code in Github: enter image description here

Settings that I have manipulated (tabs to spaces setup on VS Code): enter image description here

At this point, I don't even know if my settings are set up properly.

like image 910
Gian Paulo Zamora Avatar asked Oct 16 '25 21:10

Gian Paulo Zamora


1 Answers

You need to set your preferred tab size in github as well.

Go to your Settings (under your icon in the upper right of any repository page),

Appearance/Tab size preferences <== set to 2.

So it is a guthub issue, I think github interprets a tab as 8 spaces by default for some reason.

like image 149
Mark Avatar answered Oct 18 '25 15:10

Mark



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!