Ignoreinit is a tool for creating .gitignore files from the command line. Gitignore files are pulled from github/gitignore repo.
Prints the available templates from github/gitignore.
ignoreinit listFinds matching templates by exact name, partial name, or close spelling.
ignoreinit search <term>Prints shell completion scripts for bash, zsh, fish, or PowerShell.
ignoreinit completion <bash|zsh|fish|powershell>Creates new .gitignore based on given templates in defined location (either relative or absolute).
ignoreinit init <template...> <location>If location is omitted, ignoreinit writes to the current directory. Use explicit path syntax such as ./my-project for a relative location. Pass multiple templates to combine them:
ignoreinit init go node terraform
ignoreinit init go node terraform ./my-projectCombined output is grouped with ignoreinit section markers. Merge mode keeps existing content first and avoids stacking duplicate generated section markers.
Use --print to write generated content to stdout instead of .gitignore:
ignoreinit init go node --print > .gitignoreReplaces existing .gitignore based on given templates in defined location (either relative or absolute).
ignoreinit replace <template...> <location>Merges gitignore templates into existing .gitignore in defined location (either relative or absolute).
ignoreinit merge <template...> <location>git clone https://github.com/Loupeznik/ignoreinit
cd ignoreinit
go build -o build/ignoreinit github.com/loupeznik/ignoreinit# Create .gitignore in the current directory
docker run --rm --user "$(id -u):$(id -g)" -v ${PWD}:/work loupeznik/ignoreinit:latest init go .
# Create .gitignore in another directory directory
docker run --rm --user "$(id -u):$(id -g)" -v $HOME/projects:/work loupeznik/ignoreinit:latest init go .Ignoreinit is available as a snap for amd64 and arm64 based systems.
sudo snap install ignoreinitbrew install --cask loupeznik/tap/ignoreinityay -S ignoreinit-binYou may either install the executable directly into $GOPATH or download it from the release page.
git clone https://github.com/Loupeznik/ignoreinit
cd ignoreinit
go install github.com/loupeznik/ignoreinitOr simply install the latest version with Go without needing to clone the repo:
go install github.com/loupeznik/ignoreinit@latest