是否在更改源格式时提交? [英] Committing when changing source formatting?

查看:51
本文介绍了是否在更改源格式时提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即使您只是在更改空白,代码格式等内容时,也要提交吗?

Is it accepted practice to commit even when you're just changing things like whitespace, code formatting, etc.?

推荐答案

Yes. If you need to do whitespace changes, doing them in a separate commit that contains only this kind of cleanup is the best practice. This avoids problems with trying to see what part of a giant diff is actual code changes, and what part is just formatting (cosmetic) changes.

也就是说,您应该尝试尽量减少此类更改,并且仅在必要时才进行更改,并且与公司/社区/项目/等中使用的任何编码标准兼容。

That said, you should try to keep these kind of changes to a minimum, and only do it at all when it is necessary and compatible with whatever coding standards are used in your company / community / project / etc.

这篇关于是否在更改源格式时提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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