# gitnr

> Cross-platform CLI tool for creating .gitignore files from GitHub and TopTal template collections

Stars: 239 · Language: Rust · License: MIT · Categories: Git

- Repository: https://github.com/reemus-dev/gitnr
- Page: https://www.trmn.sh/tools/gitnr

## Install

- Homebrew: `brew install gitnr`
- Cargo: `cargo install gitnr`
- NetBSD: `pkgin install gitnr`

## Overview

gitnr is a CLI utility that generates .gitignore files by combining templates from the GitHub and TopTal gitignore collections. It supports multiple template sources including local files, remote URLs, and GitHub repositories, automatically filtering duplicate ignore patterns when merging templates.

The tool provides both command-line and interactive modes. Users can specify templates with prefixes like `gh:Rust` for GitHub templates or `tt:webstorm+all` for TopTal patches, or omit prefixes for automatic detection. The interactive search mode allows browsing and previewing available templates before selection.

gitnr caches templates for one hour to avoid API rate limits and supports cross-platform installation on Windows, macOS, Linux, and NetBSD. Output can be directed to stdout, saved directly as .gitignore in the current directory, or written to a specified file path. The tool handles TopTal's stack and patch system, where stacks combine multiple templates and patches modify existing GitHub templates.

### Installation

```bash
# via Homebrew
brew install gitnr
```

```bash
# via Cargo
cargo install gitnr
```

```bash
# via NetBSD
pkgin install gitnr
```

![gitnr demo](https://media.trmn.sh/cached/5c32a83df70f62d82a592d402fd16d067e3e1c1d01a0aaff0654d323b818dd04.gif)

## Alternatives

- [ftdv](https://www.trmn.sh/tools/ftdv.md): Terminal-based diff viewer for Git with interactive file tree navigation and configurable external diff tool support. (Rust, 72 stars)
- [lazyjj](https://www.trmn.sh/tools/lazyjj.md): Terminal UI for Jujutsu version control system, providing interactive log browsing, file management, and bookmark operations (Rust, 1.2k stars)
- [serie](https://www.trmn.sh/tools/serie.md): Terminal UI for git commit graphs using image protocols to render rich visualizations in supported terminals (Rust, 2.2k stars)
- [gitu](https://www.trmn.sh/tools/gitu.md): Terminal user interface for Git inspired by Magit, providing visual staging, branching, and repository management (Rust, 2.9k stars)
- [git absorb](https://www.trmn.sh/tools/git-absorb.md): Git subcommand that automatically creates fixup! commits from staged changes by finding the commit each hunk belongs to, with optional autosquash rebase. (Rust, 5.8k stars)

---

Canonical: https://www.trmn.sh/tools/gitnr
