3

I write code in eclipse and indent it properly there. It also looks fine in Eclipse. But when I push that code in github(I am using bitbucket) and then go to git. I see that in github(I am using bitbucket) the indentation is totally messed up.

Any solution for this.

A Paul
  • 8,113
  • 3
  • 31
  • 61

2 Answers2

3

You probably have a mixture of tabs and spaces and the tab stop settings (number of spaces that equals one tab) in git (did you mean GitHub) are different than what you have set in Eclipse.

tvanfosson
  • 524,688
  • 99
  • 697
  • 795
0

You can use http://git-scm.com/docs/gitattributes to tweak these settings.

.java text diff=java trailing-space space-before-tab -indent-with-non-tab

Ankit Kumar
  • 3,663
  • 2
  • 26
  • 38