简体   繁体   English

如何保留git repo的原始代码格式?

[英]How to preserve original code formatting of git repo?

Whenever I clone repo in local environment the code formatting ie spaces are converted to tabs no matter what ever I do even after explicitly using the option to "Convert Indentation to Spaces" (I am using sublime text3 ) it still converts in to tabs at time of commit and it adds a lot of changes even if I add 2 lines of code. 每当我在本地环境中 克隆存储库时 ,代码格式即将空格都转换为制表符 ,即使我明确使用“将缩进转换为空格” (我使用的是sublime text3选项后无论如何都会 转换制表符 提交 ,即使我添加两行代码,它也会带来很多更改。 at time of commit I get. 在提交时,我得到了。

在此处输入图片说明

basically it adds lot of changes. 基本上,它增加了很多更改。 so is there way to deal with it? 有办法解决吗?

您可以使用“ -Xignore-space-change”选项来防止git convert空白。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM