{"id":15521344,"url":"https://github.com/andrewrosss/gitig","last_synced_at":"2025-04-23T04:43:57.606Z","repository":{"id":37815075,"uuid":"477884591","full_name":"andrewrosss/gitig","owner":"andrewrosss","description":"Generate .gitignore files from the command-line","archived":false,"fork":false,"pushed_at":"2023-06-26T04:10:34.000Z","size":67,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T13:39:42.326Z","etag":null,"topics":["cargo","cli","command-line","command-line-tool","gitignore","gitignore-generator","pipx","python","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewrosss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-04T21:47:23.000Z","updated_at":"2025-02-11T16:15:01.000Z","dependencies_parsed_at":"2025-03-05T07:42:00.083Z","dependency_job_id":null,"html_url":"https://github.com/andrewrosss/gitig","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrosss%2Fgitig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrosss%2Fgitig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrosss%2Fgitig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrosss%2Fgitig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewrosss","download_url":"https://codeload.github.com/andrewrosss/gitig/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250372919,"owners_count":21419722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cargo","cli","command-line","command-line-tool","gitignore","gitignore-generator","pipx","python","rust"],"created_at":"2024-10-02T10:33:59.337Z","updated_at":"2025-04-23T04:43:57.590Z","avatar_url":"https://github.com/andrewrosss.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gitig\n\nGenerate `.gitignore` files from the command-line\n\n[![PyPI](https://img.shields.io/pypi/v/gitig)](https://pypi.org/project/gitig/) [![Crates.io](https://img.shields.io/crates/v/gitig-rs)](https://crates.io/crates/gitig-rs)\n\n`gitig` writes its output to stdout. Redirect the results to wherever makes sense for you, for example:\n\n```bash\ngi python \u003e .gitignore\n```\n\n## Installation\n\n### With `cargo`\n\n`gitig` has an implementation in Rust (and an implementation in Python) and can be installed via `cargo`:\n\n```bash\ncargo install gitig-rs\n```\n\n### With `pipx`\n\n`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`:\n\n```bash\npipx install gitig\n```\n\n### With `pip`\n\n`gitig` can also be installed via vanilla pip (or poetry, etc.):\n\n```bash\npip install gitig\n```\n\n## Usage\n\n```text\n$ gi -h\nusage: gi [-h] [-v] [--completion {bash,fish}] [--no-pager]\n          [template [template ...]]\n\npositional arguments:\n  template              Template(s) to include in the generated .gitignore\n                        file. If no templates are specified, display a list of\n                        all available templates.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -v, --version         show program's version number and exit\n  --completion {bash,fish}\n                        Generate a completion file for the selected shell.\n  --no-pager            Write template list to stdout. By default, this\n                        program attempts to paginate the list of available\n                        templates for easier reading.\n```\n\n## Examples\n\n- List all available gitignore templates (using a pager if one is available):\n\n  ```bash\n  gi\n  ```\n\n- Generate a gitignore file for Python and Jupyter:\n\n  ```bash\n  gi python jupyternotebooks\n  ```\n\n## Enable tab completion for Bash or Fish\n\n`gitig` supports generating completion scripts for Bash and Fish. Below are commands to generate completion scripts for the various shells\n\n\u003e For **Bash**, you will likely have to `source` (`.`) the generated tab completion script for it to take effect.\n\u003e\n\u003e To enable tab completion on startup you can source the completion generated completion script in your `.bashrc` or `.bash_profile`.\n\n### Bash\n\n```bash\ngi --completion bash \u003e /etc/bash_completion.d/gi.bash-completion\n```\n\n### Bash (Homebrew)\n\n```bash\ngi --completion bash \u003e $(brew --prefix)/etc/bash_completion.d/gi.bash-completion\n```\n\n### Fish\n\n```fish\ngi --completion fish \u003e ~/.config/fish/completions/gi.fish\n```\n\n### Fish (Homebrew)\n\n```fish\ngi --completion fish \u003e (brew --prefix)/share/fish/vendor_completions.d/gi.fish\n```\n\n## API\n\n### CLI\n\n```bash\ngi # query gitignore.io and list available options\n```\n\n```bash\ngi python jupyternotebooks # write a .gitingore file for python and jupyter to stdout\n```\n\n```bash\ngi --completion bash # write generated bash autocompletion script to stdout\ngi --completion fish # write generated fish autocompletion script to stdout\n```\n\n```bash\ngi --version # write gitig version info to stdout\n```\n\n### Autocompletion\n\n```bash\ngi \u003cTAB\u003e\u003cTAB\u003e\n1c                         1c-bitrix                  actionscript\nada                        adobe                      advancedinstaller          adventuregamestudio\nagda                       al                         alteraquartusii            altium\n...\n```\n\n```bash\n$ gi python j\u003cTAB\u003e\u003cTAB\u003e\njabref  jboss6          jekyll         jetbrains+iml  joe     jupyternotebooks\njava    jboss-4-2-3-ga  jenv           jgiven         joomla  justcode\njboss   jboss-6-x       jetbrains      jigsaw         jspm\njboss4  jdeveloper      jetbrains+all  jmeter         julia\n```\n\n### Rust API\n\n```rust\ngitig::list_templates();  // same as `gi`\ngitig::create(vec!['python', 'jupyter']);  // same as `gi python jupyter`\ngitig::bash_completion();  // same as `gi --completion bash`\ngitig::fish_completion();  // same as `gi --completion fish`\ngitig::VERSION;\n```\n\n### Python API\n\n```python\nimport gitig\n\ngitig.list_templates()  # same as `gi`\ngitig.create(['python', 'jupyter'])  # same as `gi python jupyter`\ngitig.bash_completion()  # same as `gi --completion bash`\ngitig.fish_completion()  # same as `gi --completion fish`\ngitig.__version__\n```\n\n## Contributing\n\n### Rust\n\n1. Fork the repo\n1. Run `cargo build`\n1. Run `pre-commit install`\n1. Add your changes (adding/updating tests is always nice too)\n1. Commit your changes + push to your fork\n1. Open a PR\n\n### Python\n\n1. Have or install a recent version of `poetry` (version \u003e= 1.1)\n1. Fork the repo\n1. Setup a virtual environment (however you prefer)\n1. Run `poetry install`\n1. Run `pre-commit install`\n1. Add your changes (adding/updating tests is always nice too)\n1. Commit your changes + push to your fork\n1. Open a PR\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewrosss%2Fgitig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewrosss%2Fgitig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewrosss%2Fgitig/lists"}