Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set tab size in GitHub web interface

So I recently created a GitHub account. Among other things a problem that I seem to have it tabs. When you are creating a new folder in repository, Github hasthe following options:

  • Indent Mode
    • Spaces
    • Tabs
  • Indent Size
    • 2
    • 4
    • 8
  • Line Wrap mode
    • No wrap
    • Soft wrap

The problem I seem to be having is that when I set the following values:

  • indent mode to tabs
  • indent size to 4

When I save that file it is automatically set to tabs and 8

What is going on here?

Why is indent size getting set to 8 even when I specifically set it to 4?

like image 496
Muhammad Salman Avatar asked Mar 29 '26 00:03

Muhammad Salman


1 Answers

The default tab size in GitHub is set to 8.

You can achieve indentation by using selecting indent mode as spaces and setting it to 4 or whatever you want.

To check the file on GitHub with different indentation you can append ?ts=2 or ?ts=4 to the URL to change the tab-size.

like image 56
Harshal Y. Avatar answered Apr 02 '26 02:04

Harshal Y.



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!