Github上Java Eclipse项目的奇怪缩进 [英] Strange indenting for Java Eclipse project on Github

查看:135
本文介绍了Github上Java Eclipse项目的奇怪缩进的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Eclipse中的一切都很好,缩进也很好。然后我把我的代码放在github
上,由于某种原因,缩进是一团糟。我不确定发生了什么事情?



谢谢 如果这些缩进问题在git推送到GitHub后反映回代码中,您可以使用以下命令:



这两个自动机制可以解释 git commit 中的更改。






但是,如果您的代码在本地后看起来不错,那么git push会显示在GitHub上没有问题,那么你必须在本地正确渲染空间和标签的组合,并在GitHub上以不同方式呈现。


$ b 正如缩进问题使用崇高的文字2


问题不是硬标签,问题是混合空格和制表符用于缩进。



Everything is good in Eclipse, indenting is fine. Then I put my code on github and for some reason the indenting was a mess. I am not sure what is going on?

Thanks

解决方案

If those indentation issues are reflected back in your code after a git push to GitHub, you either have:

Those are the two automatic mechanisms that could explain a change during the git commit.


But if your code looks fine locally after the git push, but looks not fine on GitHub, then you must have a combination of space and tabs correctly rendered locally, and rendered differently on GitHub.

As mentioned in "Indentation issue using sublime text 2":

The problem is not hard tabs, the problem is mixing spaces and tabs for indentation.

这篇关于Github上Java Eclipse项目的奇怪缩进的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆