DEV Community

Cover image for gitignore.io is great!

gitignore.io is great!

Mike Bifulco on August 05, 2020

Put simply, gitignore.io is a that is so profoundly helpful that I've forgotten what life was like without it. Its purpose is simple: for any proj...
Collapse
 
waylonwalker profile image
Waylon Walker • Edited

I had no idea there was a cli, I always just use CURL. I generally use pretty similar .gitignore's depending on the type of project that I am working on.

I keep this one as a shell alias

alias ignore='curl https://www.gitignore.io/api/vim,node,data,emacs,python,pycharm,executable,sublimetext,visualstudio,visualstudiocode > .gitignore'
Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

It's just a shell script, but working at function level.

I do this quite often.

gi macos,node > .gitignore 

You can't misspell, though. For example, it must be node not node.js or nodejs.

Collapse
 
titanhero profile image
Lex

You miss the ' ' in the alias, anyway cool.

Collapse
 
waylonwalker profile image
Waylon Walker

Thanks for the catch, fixed it

Collapse
 
vlasales profile image
Vlastimil Pospichal

I don't want to distribute a list of my private files and directories in project to other developers. I save my settings to .git/info/exclude

Collapse
 
irreverentmike profile image
Mike Bifulco

Sure - I get that. There's a purpose for that ~/.git directory in addition to .gitignore on individual projects. The latter is useful if you ever work with anyone else, which is where this config and tool come in...

Collapse
 
vlasales profile image
Vlastimil Pospichal

Each developer on a project can have a different IDE and it is unnecessary to accumulate it in one .gitignore. The third solution is the global .gitignore.

I usually use my own Makefile to handle the project on local machine.

Thread Thread
 
irreverentmike profile image
Mike Bifulco

Different strokes, I suppose. There are absolutely some files that are regularly .gitignoreed that are independent of IDE.

node_modules/ forel example, and often there are .env.something files with varying names depending on the project type.

I'm sure you've experienced this in varying degrees throughout your career - there's rarely a clear-cut, single answer to anything we do. I'm not sure it benefits anyone much to world such a broad cudgel as to call a tool like this unhelpful because of your preference.

I'd imagine we could think of a dozen other reasons for and against this over a coffee. Maybe we will get to one day!

Collapse
 
33nano profile image
Manyong'oments

Awesome, definitely going to use it.

Collapse
 
irreverentmike profile image
Mike Bifulco

Sweet! I'd love to hear what you think. It's been super useful to me.

Collapse
 
dploeger profile image
Dennis Ploeger

Awesome. Thanks for pointing that out. I didn't know about that tool.

Collapse
 
irreverentmike profile image
Mike Bifulco

Glad you found it helpful!

Collapse
 
premedios profile image
Pedro Remedios

This tool does not invalidate all the manual guess work that was done before this existed!

Collapse
 
irreverentmike profile image
Mike Bifulco

Of course not, but it definitely helps smooth out the workflow now. You also benefit from the work of the community this put this together - which is one of the things I really love about open source software. If you feel particularly strongly about the way you organized your .gitignore files in the past, why not submit your work as a pull request?

Collapse
 
jamesbright profile image
James Ononiwu

cool, i didn't know this exist.

Collapse
 
xmariopereira profile image
Mario Pereira

IntelliJ (or any jet brains product) already does that for you.

Collapse
 
irreverentmike profile image
Mike Bifulco

Always more than one way to skin a cat!