A CLI tool that generates .gitignore files from GitHub's gitignore template collection. Templates are embedded directly in the binary, so it works offline after building.
cargo build --release
./target/release/gig pythonbrew install dgerlanc/tap/gigDownload the appropriate binary from the releases page.
# 1. Clone this repo
git clone https://github.com/dgerlanc/gig.git
cd gig
# 2. Download templates
git clone https://github.com/github/gitignore.git templates
# 3. Build
cargo build --release
# 4. (Optional) Install to ~/.cargo/bin
cargo install --path .# Create .gitignore for Python in current directory
gig python
# Multiple languages, comma-separated
gig go,nextjs,terraform
# Specify an output path
gig rust src/.gitignore
# Append to an existing .gitignore, deduplicating patterns
gig --append node
# Use nested templates (Global/, community/)
gig global.macos
gig go,community.golang.hugo
# List all available languages
gig --list
# Show help
gig --helpLanguage matching is case-insensitive, so gig Python and gig python both work.
Templates from GitHub's Global/ and community/ subdirectories are available using dot-notation:
- Global templates:
global.<name>(e.g.,global.macos,global.linux) - Community templates:
community.<subcategory>.<name>(e.g.,community.javascript.vue,community.cfml.coldbox)
Run gig --list to see all available template names.
To pull the latest templates from GitHub:
cd templates && git pull
cargo build --releasecargo build # Build debug binary
cargo build --release # Build release binary
cargo test # Run all tests
cargo clippy # Run linter
cargo fmt # Format codeThe templates/ directory contains .gitignore files from github/gitignore. Rust's include_dir! macro bakes these files into the binary at compile time. The result is a single static binary with no runtime dependencies.
APACHE 2.0