A simple command-line tool to manage .gitignore files from anywhere in your repo.
curl -fsSL https://raw.githubusercontent.com/hyrfilm/gitignore/master/gitignore -o ~/.config/gitignore && chmod +x ~/.config/gitignore && ln -sf ~/.config/gitignore ~/.local/bin/gitignore
~/.local/binshould already be on your PATH. If not, add this to your~/.zshrcor~/.bashrc:export PATH="$HOME/.local/bin:$PATH"
gitignore .env .DS_Store # add one or more patterns
gitignore --defaults # common patterns (.DS_Store, .env, *.log, .vscode/ ...)
gitignore --python # Python patterns (__pycache__/, .venv/, .pytest_cache/ ...)
gitignore --js # JS/Node patterns (node_modules/, dist/, .next/ ...)
gitignore --list # show current .gitignore
gitignore --undo coverage # remove a pattern and untrack matching filesWorks from any subdirectory — the tool walks up to find the repo root automatically.
Already-tracked files matching a newly added pattern are untracked via git rm --cached.
curl -fsSL https://raw.githubusercontent.com/hyrfilm/gitignore/master/gitignore -o ~/.config/gitignorerm ~/.config/gitignore ~/.local/bin/gitignore