gitignore.in
Website: https://gitignore.in/
Motivation
The method of generating .gitignore from a template is already widespread.
For example, there are the following methods.
- gibo
- gitignore.io
- .gitignore generated when creating a repository on GitHub
However, the .gitignore file generated by these methods is not updated over time.
The result of gibo dump Python executed in 2018 and the result of gibo dump Python executed in 2023 will be different.
In order for the project to use the latest .gitignore, you need to update .gitignore regularly.
However, this is a troublesome task that can cause mistakes.
Solution
gitignore.in is a Command Line Interface (CLI) tool that generates .gitignore from a template.
Usage
Show the CLI help:
Generate .gitignore.in if needed and build .gitignore:
If .gitignore.in does not exist but .gitignore already exists, gitignore.in first infers a starting .gitignore.in and then rebuilds .gitignore.
In the .gitignore.in file, write the template you want to use like shell script.
# See https://gitignore.in/
# Edit this file and run `gitignore.in` to rebuild .gitignore
# This is a comment
When you run gitignore.in again, .gitignore will be updated.
If you already have a .gitignore, you can infer a starting .gitignore.in from it.
Search available templates before adding them. This matches template names case-insensitively by substring:
Add templates without worrying about gibo vs gi.
gitignore.in resolves names case-insensitively, prefers the provider already used in .gitignore.in, and rebuilds .gitignore after the update.
Remove templates in the same way:
This infer mode is heuristic.
It tries to cover the existing .gitignore with the specified gibo dump ... and gi ... candidates, then falls back to echo '...' for unmatched lines.
If you omit both --gibo and --gi, it checks all available templates from both providers.
If the .gitignore was already generated by gitignore.in, you can restore .gitignore.in from its embedded section headers.
Installation
Binary Releases
Download the binary from the releases page. And place it in a directory that is in the PATH.
Homebrew installation
Manual Installation
License
MIT License