Dealing with space changes
Especially when working with legacy code, sometimes large amounts of space changes will find their way into your working director. This could be due to a newly-added linting process, or a code editor or IDE auto-cleaning empty space characters, etc.
In cases where you find a large number of space changes in your working changes, you still want to try and adhere to the
practice of writing atomic commits. When you encounter this, add only the space changes to
a commit with a message like “Lint recently edited files,” etc. Often it’s easier to first add the non space-changes to
a commit (consider using the -p
flag), especially if it’s just a few lines of
real changes. Then add the space changes en masse and commit them together under their own commit.