Ignoreinit is a tool for creating .gitignore files from the command line. Gitignore files are pulled from github/gitignore repo.
Creates new .gitignore based on given language in defined location (either relative or absolute).
ignoreinit init <language> <location>
Replaces existing .gitignore based on given language in defined location (either relative or absolute).
ignoreinit replace <language> <location>
Merges a gitignore for given language into existing .gitignore in defined location (either relative or absolute).
ignoreinit merge <language> <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 -v ${PWD}:/work loupeznik/ignoreinit:latest init go .
# Create .gitignore in another directory directory
docker run --rm -v $HOME/projects:/work loupeznik/ignoreinit:latest init go .
Ignoreinit is available as a snap for amd64 and arm64 based systems.
sudo snap install ignoreinit
On Debian-based distros, ignoreinit can be installed via apt using a custom apt repo. This option is currently supported for amd64 systems.
sudo -s
apt install -y curl gpg
curl -fsSL https://apt.dzarsky.eu/apt-repo-dzarsky.gpg | gpg --dearmor > /etc/apt/trusted.gpg.d/apt-repo-dzarsky.gpg
echo "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/apt-repo-dzarsky.gpg] https://apt.dzarsky.eu /" > /etc/apt/sources.list.d/apt-repo-dzarsky.list
apt update
apt install ignoreinit
You 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/ignoreinit
Or simply install the latest version with Go without needing to clone the repo:
go install github.com/loupeznik/ignoreinit@latest