DEV Community

Cover image for To commit editor files or not?
Jon Lauridsen
Jon Lauridsen

Posted on

To commit editor files or not?

.idea, .vscode, vimdc, lots of editors produce editor files, but… should you commit them? Or is it clutter and everyone should roll their own setup?

We could sit here and weigh the pros and cons, and debate with specific files bring more value than others, but I think it's actually not necessary:

Yes definitely commit them (given a few sensible constraints). Why? Because if they help someone then don't stand in their way. It's much more fun and inclusive to welcome those files! Sure you may not use them, maybe you think they just clutter up the root directory and litter in commits, but if you prioritize your team member's happiness they become easier to ignore.

What constraints though?

  • Keep the clutter small, e.g. if your editor produces several files can you find a way to put them all in a single subfolder?
  • Avoid editor files that are constantly updating, no-one wants a commit-history dominated by editor file commits.
  • If multiple people use the same editor they should explicitly agree on what files to commit. Don't commit a file if there is disagreement.

I'm purposefully sidestepping an analysis of the specific pros and cons because quite frankly I think it's more important we prioritize making the codebase a welcoming, easy place to work in. But, if you're hungry for a concrete example, I happen to use the IntelliJ editor and by committing a few project files it becomes painless to switch branches and have the project's modules stay properly configured. But really this post exists to suggest that if someone feels something helps them, then let's try to welcome that.

Photo by Gabriel Heinzer on Unsplash

Discussion (0)