The company Toptal runs a wonderful api for composing a .gitignore on the fly
By composing, I mean you give it a list of components that should be considered (Operating Systems, IDEs, Programming Languages), and it generates a .gitignore snippet for each and concatenates them into one.
The api has a web interface at https://www.toptal.com/developers/gitignore
But also an api at https://www.toptal.com/developers/gitignore/api/ that can be interacted with from the command line:
curl -s https://www.toptal.com/developers/gitignore/api/
Which returns
gitignore.io help:
list - lists the operating systems, programming languages and IDE input types
:types: - creates .gitignore files for types of operating systems, programming languages or IDEs
In this byte we’ll use the api to create some .gitignore files for a project and then see how to call the api directly from git.
If you just want the main takeaways, go to the tl;dr at the end.