#cli #git #gitignore #vcs

bin+lib gib

A .gitignore bootstrapper for projects that use git

8 releases

0.2.4 Jul 5, 2020
0.2.3 May 22, 2020
0.1.2 Apr 29, 2020

#1629 in Command line utilities

48 downloads per month

MIT OR GPL-3.0

1MB
251 lines

gib - A .gitignore bootstrapper for projects using git

Crates.io Travis CI build License

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

Homebrew (macOS)

brew install davsanchez/gib/gib

Or brew tap davsanchez/gib and then brew install gib.

From crates.io

If you have installed Rust on your machine, you can just do:

cargo install gib

Installing from source

You'll also need Rust installed for this one:

git clone https://github.com/DavSanchez/gib.git --recurse-submodules
cd gib
cargo install

Usage

Create .gitignore at current directory (if it doesn't exist)

gib [<template>...] 

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

gib [<template>...] [-o|--output] [<path>]

Get list of available templates

gib [-l|--list]

Print result of specified templates to stdout only

gib [<template>...] [-s|--show]

This flag takes precedence over --append, --replace and --output flags.

Examples

Output .gitignore file for Go and Rust

gib go rust

.gitignore

###############
###############
*.exe
*.exe~
*.dll
*.so
*.dylib

*.test

*.out


###############
###############
/target/

Cargo.lock

**/*.rs.bk

Pending changes

  • Additional means of installation (brew for macOS, scoop or choco for Windows, etc.)
  • Good manpages, completion and documentation.
  • Replace .gitignore template loading with lazy_static or phf.
  • Refactor, refactor...

Dependencies

~3MB
~55K SLoC