+
Skip to content

wojtyniak/gitignore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitignore

Download and append .gitignore templates from the github/gitignore repository to your local project.

Why?

Tired of manually downloading .gitignore files or copying them between repos? This script makes it effortless to grab the right template and append it to your local .gitignore.

Installation

Place the gi script somewhere in your PATH, for example:

wget https://raw.githubusercontent.com/wojtyniak/gitignore/refs/heads/master/gi -O ~/bin/gi
chmod +x ~/bin/gi

Note: Ensure ~/bin is in your PATH.

Usage

gi <keyword>

The script intelligently handles different search scenarios:

Single match → Direct confirmation

$ gi swift
Searching for templates containing 'swift'...
Found exact match: Swift
Do you want to append this template to '.gitignore'? [Y/n]: y
Fetching Swift template...
Successfully appended Swift template to '.gitignore'

Multiple matches with exact match → Smart suggestion

$ gi go
Searching for templates containing 'go'...
Found 3 templates matching 'go':
Go.gitignore
Godot.gitignore
IGORPro.gitignore

Found exact match: Go
Do you want to append this template to '.gitignore'? [Y/n]: y
Fetching Go template...
Successfully appended Go template to '.gitignore'

Multiple matches, no exact match → Show options

$ gi ru
Searching for templates containing 'ru'...
Found 3 templates matching 'ru':
Drupal.gitignore
Ruby.gitignore
Rust.gitignore

Use './gi <template_name>' to add a specific template

Features

  • Smart search: Handles partial matches intelligently
  • Interactive confirmation: Always asks before modifying your .gitignore
  • Append mode: Adds to existing .gitignore instead of overwriting
  • No dependencies: Single bash script, no Node.js or Python required
  • Official source: Pulls directly from GitHub's template repository

Testing

Run the provided test script:

cd test
./test_gi.sh

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Download .gitignore templates from github/gitignore

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载