Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitignore-gen

A small, dependency-free command-line tool that looks at what's actually in your project directory and generates (or updates) a .gitignore to match — no need to go copy-paste one from a website.

Why

Most .gitignore generators are a web form. This one runs locally, scans for marker files (package.json, pyproject.toml, go.mod, ...), and writes only what's relevant. Run it again later after adding a new stack and it'll top up the file instead of clobbering it.

Install

pip install .

This installs a gitignore-gen command on your PATH.

Usage

gitignore-gen                # scan the current directory
gitignore-gen path/to/repo   # scan a specific directory

Example output:

gitignore-gen: added 12 line(s) to ./.gitignore

Running it again once the file already covers everything detected:

gitignore-gen: .gitignore already covers everything detected — nothing to add

Options

Flag Description
--dry-run Print what would be added without writing the file
--list-templates List available templates and the markers that trigger them

Supported project types

Python, Node, Java, Go, Rust, Ruby — plus a universal section (OS files, editor directories, .env) that's always included. Run gitignore-gen --list-templates to see exactly which files trigger which section.

Existing .gitignore content is never removed or reordered — new lines are only appended, under a clearly marked # --- added by gitignore-gen --- section, and only if they aren't already present somewhere in the file.

Development

pip install -e .
python -m unittest discover -s tests -v

License

All rights reserved. This code is public for viewing and reference only — no license is granted to use, copy, modify, or redistribute it. See LICENSE for details.

About

Detect your project type(s) and generate or update a .gitignore, with no dependencies.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages