#git #ignore #generator #cli

bin+lib gign

A smart command line tool to generate .gitignore files

5 unstable releases

0.3.0 Jul 17, 2022
0.2.0 Jul 17, 2022
0.1.2 Jul 12, 2022
0.1.1 Jul 12, 2022
0.1.0 Jul 12, 2022

#5 in #gitignore-templates

Download history 9/week @ 2023-10-30 1/week @ 2023-11-13 11/week @ 2023-11-20 22/week @ 2023-11-27 5/week @ 2023-12-18 10/week @ 2023-12-25 5/week @ 2024-01-08 10/week @ 2024-01-22 15/week @ 2024-01-29 6/week @ 2024-02-05 26/week @ 2024-02-12

57 downloads per month

MIT license

496 lines


A Gitignore Generator

Table of Contents


# This is how you going to use it probably most of the time
gign rust linux -a # -a short for --append

# It's smart!
# This will expand to python, jetbrains and linux
gign pyton jjetbrainz linus > .gitignore

# Append to the repository root-level .gitignore automatically
gign --append haskell

# Do not automatically resolve unknown templates
gign --append --strict macos
# error: template 'macos' not found, did you mean 'global:macOS'?

# Ignore all javascript related templates
gign $(gign list javascript) node > .gitignore

# Search for template with fzf and use it
gign $(gign list | fzf) > .gitignore

see gign list to show all available templates


Using Cargo

cargo install gign

Custom templates

By default, templates are taken from https://github.com/github/gitignore

To add custom template just create [name].gitignore file inside gign where directory.

Files inside folders will be prefixed with the parent folder name (except for the root templates).

For example, if you have custom.gitignore file inside extras/ folder, you can use it like this:

gign --strict extras:custom

# or
gign extras:custom

# or
gign custom
Location Strict Name
custom.gitignore custom
extras/custom.gitignore extras:custom
extras/misc/custom.gitignore misc:custom


    gign [OPTIONS] [template]... [SUBCOMMAND]

    <template>...    The templates to ignore

    -a, --append     Append to the root-level .gitignore file
    -h, --help       Print help information
    -s, --strict     Do not automatically resolve unknown templates
    -V, --version    Print version information

    help      Print this message or the help of the given subcommand(s)
    list      List all available templates
    update    Update the default templates database
    where     Print the templates path


~83K SLoC