Crates.io | gitig-rs |
lib.rs | gitig-rs |
version | 23.4.0 |
source | src |
created_at | 2023-04-26 08:07:40.269893 |
updated_at | 2023-04-26 08:07:40.269893 |
description | Generate .gitignore files from the command-line |
homepage | https://github.com/andrewrosss/gitig |
repository | https://github.com/andrewrosss/gitig |
max_upload_size | |
id | 849160 |
size | 50,961 |
Generate .gitignore
files from the command-line
gitig
writes its output to stdout. Redirect the results to wherever makes sense for you, for example:
gi python > .gitignore
cargo
gitig
has an implementation in Rust (and an implementation in Python) and can be installed via cargo
:
cargo install gitig-rs
pipx
gitig
is intended to be used as an end-user command-line application (i.e. not as a package's dependency). The easiest way to get started is with pipx
:
pipx install gitig
pip
gitig
can also be installed via vanilla pip (or poetry, etc.):
pip install gitig
$ gi -h
usage: gi [-h] [-v] [--completion {bash,fish}] [--no-pager]
[template [template ...]]
positional arguments:
template Template(s) to include in the generated .gitignore
file. If no templates are specified, display a list of
all available templates.
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
--completion {bash,fish}
Generate a completion file for the selected shell.
--no-pager Write template list to stdout. By default, this
program attempts to paginate the list of available
templates for easier reading.
List all available gitignore templates (using a pager if one is available):
gi
Generate a gitignore file for Python and Jupyter:
gi python jupyternotebooks
gitig
supports generating completion scripts for Bash and Fish. Below are commands to generate completion scripts for the various shells
For Bash, you will likely have to
source
(.
) the generated tab completion script for it to take effect.To enable tab completion on startup you can source the completion generated completion script in your
.bashrc
or.bash_profile
.
gi --completion bash > /etc/bash_completion.d/gi.bash-completion
gi --completion bash > $(brew --prefix)/etc/bash_completion.d/gi.bash-completion
gi --completion fish > ~/.config/fish/completions/gi.fish
gi --completion fish > (brew --prefix)/share/fish/vendor_completions.d/gi.fish
gi # query gitignore.io and list available options
gi python jupyternotebooks # write a .gitingore file for python and jupyter to stdout
gi --completion bash # write generated bash autocompletion script to stdout
gi --completion fish # write generated fish autocompletion script to stdout
gi --version # write gitig version info to stdout
gi <TAB><TAB>
1c 1c-bitrix actionscript
ada adobe advancedinstaller adventuregamestudio
agda al alteraquartusii altium
...
$ gi python j<TAB><TAB>
jabref jboss6 jekyll jetbrains+iml joe jupyternotebooks
java jboss-4-2-3-ga jenv jgiven joomla justcode
jboss jboss-6-x jetbrains jigsaw jspm
jboss4 jdeveloper jetbrains+all jmeter julia
gitig::list_templates(); // same as `gi`
gitig::create(vec!['python', 'jupyter']); // same as `gi python jupyter`
gitig::bash_completion(); // same as `gi --completion bash`
gitig::fish_completion(); // same as `gi --completion fish`
gitig::VERSION;
import gitig
gitig.list_templates() # same as `gi`
gitig.create(['python', 'jupyter']) # same as `gi python jupyter`
gitig.bash_completion() # same as `gi --completion bash`
gitig.fish_completion() # same as `gi --completion fish`
gitig.__version__
cargo build
pre-commit install
poetry
(version >= 1.1)poetry install
pre-commit install