Caballero
Caballero

Reputation: 12101

git tab space difference issue

For some reason, if I indent anything with a tab in any file like this:

Before:

something {
text
}

After:

something {
    text
}

git diff shows me this instead:

something {
        text
}

I've tried couple different editors (Eclipse, Gedit), but the outcome is the same. My question is: why does git sees a tab as 8 spaces instead of 4? How do I fix this?

I've tried this:

git config --global core.pager 'less -x4'

So now the tab size in git diff is correct, but when I push it to remote repository (Bitbucket), it still shows as 8 spaces instead of 4. I don't understand. When I worked on windows everything was fine, but now that I've switched to Ubuntu I have this problem.

I'm using Ubuntu 13.10 (Saucy Salamander) 64bit

Upvotes: 1

Views: 229

Answers (1)

Caballero
Caballero

Reputation: 12101

Apparently, this is an ongoing issue on Bitbucket https://bitbucket.org/site/master/issue/6207/fix-tab-size-in-source-code-viewer-bb-7488 so it has nothing to do with git itself.

Upvotes: 1

Related Questions