https://github.com/samedwardes/gitignore
A CLI to create gitignore templates from https://github.com/github/gitignore
https://github.com/samedwardes/gitignore
cli git
Last synced: 2 months ago
JSON representation
A CLI to create gitignore templates from https://github.com/github/gitignore
- Host: GitHub
- URL: https://github.com/samedwardes/gitignore
- Owner: SamEdwardes
- Created: 2023-04-04T03:59:35.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-11T23:58:39.000Z (about 3 years ago)
- Last Synced: 2025-03-28T20:14:47.234Z (over 1 year ago)
- Topics: cli, git
- Language: TypeScript
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gitignore
A CLI for quickly generating .gitignore templates from GitHub's `.gitignore` repo .
## Install
Download your desired version from the GitHub releases page . Unpack the tarball and move to a location on your path. For example:
```bash
# M1 Mac
wget -O gitignore.tgz https://github.com/SamEdwardes/gitignore/releases/download/v0.1.0-alpha/gitignore-0.1.0-alpha-aarch64-apple-darwin.tgz
tar -xf gitignore.tgz
mv gitignore "$HOME/.local/bin/"
```
## Usage
```bash
Usage: gitignore
Version: 0.1.0
Description:
Get .gitignore templates from GitHub's .gitignore templates repo (https://github.com/github/gitignore).
Options:
-h, --help - Show this help.
-V, --version - Show the version number for this program.
-l, --list [list] - Show a list of available templates.
-c, --commit [commit] - Use the .gitignore from a specific commit. If you are using the gitignore CLI in (Default: "main")
a pipeline you may want to set this value to ensure reproducibility.
```
## Examples
Create a new *.gitignore* for a Python project:
```bash
gitignore python > .gitignore
```
Append the *.gitignore* template for R to an existing .gitignore file:
```bash
gitignore r >> .gitignore
```
See a list of available .gitignore templates:
```bash
gitignore --list
```
Search for a specific template:
```bash
gitignore --list | grep rust
```
Use a .gitignore template from a specific commit from the https://github.com/github/gitignore repo. This is useful if you want to use `gitignore` in a CI/CD pipeline.
```bash
gitignore python --commit af7786b54d206f7101b128616df9e14341f52f96 > .gitignore
```