Issue
Whenever I commit my code on bitbucket, My Tab-space indentation do not match with other Devlopers, Though Netbeans showing it with proper indentation. Is this problem of Netbeans tab setting or bitbucket? Is there any way we can provide Tab setting to change as per pulled file Tab setting?
Solution
This probably because you are using Tabs and the others expand those to spaces. The size of a tab differs somewhere between 2 and 8 spaces and this destroys any formatting.
Just set the option to expand Tabs to spaces and the problem is solved. You can use your IDE as usual, but the file will contain fixed spaces (eg. 4 spaces) instead of a hard tab ("\t").
To do this:
- Open
Tools --> Options
and go toEditor -> Formatting
- Language: All Languages
- Category: Tabs and Indents
- Select Expand Tabs to Spaces and a Number of spaces / Tab size of 4 (or whatever is used in your project)
You can check this by enabling View --> Show Non-Printable Characters
. This should show bullets if spaces are used but some kind of arrow for Tabs.
Answered By - ollo
Answer Checked By - Senaida (JavaFixing Volunteer)