gib - A .gitignore bootstrapper for projects using git
This is a small utility for those who need to generate .gitignore files for different languages or frameworks. gib uses .gitignore templates, allowing to check and generate these files from them. The templates are collected directly from GitHub's own gitignore repository.
Installation
You can download the binaries for the available platforms at GitHub's releases page
Additionally, if you have installed Rust on your machine, you can just do:
Usage
Create .gitignore at current directory (if it doesn't exist)
If a .gitignore file already exists at that location, gib will do nothing.
If you want to extend an existing file instead, use the -a|--append flag. If you want to overwrite it, use -r|--replace (append takes precedence over replace).
Create .gitignore at other directory
Get list of available templates
Print result of specified templates to stdout only
This flag takes precedence over --append, --replace and --output flags.
Examples
Output .gitignore file for Go and Rust
.gitignore
###############
# Go
###############
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, built with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Dependency directories (remove the comment below to include it)
# vendor/
###############
# Rust
###############
# Generated by Cargo
# will have compiled files and executables
/target/
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk
Pending changes
- Additional means of installation (
brewfor macOS,scooporchocofor Windows, etc.) - Good manpages, completion and documentation.
- Replace
.gitignoretemplate loading withlazy_staticorphf. - Code's a mess, to be honest. Must find a way to refactor and design it better, more idiomatic.