Is it accepted practice to commit even when you’re just changing things like whitespace, code formatting, etc.?
Is it accepted practice to commit even when you’re just changing things like whitespace,
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.