Difference in github branch from what I pushed

Viewed 36

I've edited a file in my java program and pushed it to a branch called 'develop'.

I added a line changing it from:

    else 
        message = guess + " is correct. You win!";

To:

    else {  
        message = guess + " is correct. Let's play again!";
        newGame();
    }

After I push to the develop branch this is what I see in github:

    else {  
           message = guess + " is correct. Let's play again!";
        newGame();
    }

Not that it matters for Java. But the indentation is off. Why would there be a difference in what I see in github from what I pushed and what I see in my eclipse IDE? Exclipse is set to the correct branch I pushed to.

1 Answers

I think this similar to here. Basically, you should probably switch Eclipse to use spaces instead of tabs since, as @mkrieger1 said, tabs can be rendered differently. Spaces will be more consistent between systems.

You may also have to update the formatter settings: Window -> Preferences -> Java -> Code Style -> Formatter

Create new profile and then click "Edit": Indentation -> Tab policy

Related