Git protip: easy templates for `.gitignore`
By Maxime Bréhin • Published on 10 April 2023 • 1 min

You may have read our tutorial which explains how to ignore (or not) files in Git. So, you started writing your .gitignore file at the root of your project, and you probably realized that there were plenty of things to add to it:

  • files related to the operating system (.DS_Store files on Mac, Thumbs.db on Windows, .swp on linux…) ;
  • technical files related to an IDE or the project context (.settings/ for Eclipse, .idea_modules/ for WebStorm/PhpStorm…).

How about we leverage existing templates?

You may have already seen, or even used, the templates provided by some platforms such as GitLab (at project initialization).

Preview of  template loading in GitLab

But it gets even better! Let me introduce you to the ultimate .gitignore generation tool: gitignore.io!

Preview of the "gitignore.io" homepage

It doesn’t get any easier: just fill in the tools, languages, OS… people work with on your project, then click “Create”, and you get a text content that you can copy-paste into the .gitignore file for your project.

Isn’t life great?

Want more tips and tricks?

We’ve got a whole bunch of existing articles and more to come. Also check out our 🔥 killer Git training course: 360° Git!

Would you like to go one step further and fully master Git core concepts, or to get advice on how to guarantee the quality of your Git projects? We can help or train you - just tell us what you need!