https://github.com/metafates/gign
⚙️ A cute .gitignore generator
https://github.com/metafates/gign
cli gitignore gitignore-generator gitignore-templates rust
Last synced: about 1 year ago
JSON representation
⚙️ A cute .gitignore generator
- Host: GitHub
- URL: https://github.com/metafates/gign
- Owner: metafates
- License: mit
- Created: 2022-07-10T11:30:41.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-17T17:43:42.000Z (almost 4 years ago)
- Last Synced: 2025-04-14T14:22:52.105Z (about 1 year ago)
- Topics: cli, gitignore, gitignore-generator, gitignore-templates, rust
- Language: Rust
- Homepage: https://crates.io/crates/gign
- Size: 62.5 KB
- Stars: 15
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Gign
A Gitignore Generator
## Table of Contents
- [Examples](#examples)
- [Install](#install)
- [Custom templates](#custom-templates)
- [Help](#help)
## Examples
```bash
# 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
## Install
Using [Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html)
```
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:
```bash
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` |
## Help
```
USAGE:
gign [OPTIONS] [template]... [SUBCOMMAND]
ARGS:
... The templates to ignore
OPTIONS:
-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
SUBCOMMANDS:
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
```