Skip to content

Welcome to gi

Python Tests Build Coverage License PyPI Downloads

A fast, intelligent CLI tool that fetches and combines official .gitignore templates from github/gitignore into a single, deduplicated .gitignore file.

✨ Features

  • 🚀 Fast: Caches templates locally for offline use
  • 🧠 Smart: Deduplicates rules across templates while preserving comments
  • 🔍 Searchable: List and search through 200+ available templates
  • 🎯 Flexible: Support for aliases, case-insensitive names, and custom output paths
  • 💪 Robust: Graceful fallback to cached content when offline
  • 🖥️ Cross-platform: Works on macOS, Linux, and Windows

🚀 Quick Start

Installation

Recommended (using pipx):

pipx install gi

Alternative (using pip):

pip install gi

From source:

git clone https://github.com/sempervent/gi.git
cd gi
pip install -e .

Basic Usage

# Combine multiple templates
gi main python rust node

# List available templates
gi list

# Search for templates
gi search studio

# Show template content
gi show Global/JetBrains

📖 Documentation

This documentation covers everything you need to know about gi:

🎯 Use Cases

For Developers

  • Quickly set up .gitignore files for new projects
  • Combine multiple language-specific templates
  • Maintain consistent ignore patterns across projects

For Teams

  • Standardize .gitignore files across team projects
  • Automate .gitignore generation in CI/CD pipelines
  • Share common ignore patterns between projects

For Open Source

  • Generate comprehensive .gitignore files for multi-language projects
  • Maintain up-to-date ignore patterns from official templates
  • Reduce maintenance overhead of custom .gitignore files

🔧 Advanced Features

Template Aliases

# Use convenient aliases
gi main cpp csharp vscode  # C++, C#, VS Code
gi main python django      # Python with Django
gi main node react         # Node.js with React

Custom Output

# Specify output file
gi main python rust -o my-project/.gitignore

# Append to existing file
gi main python -a existing/.gitignore

Offline Usage

# Works offline with cached templates
gi main python rust  # Uses cached templates if network unavailable

📊 Supported Templates

gi supports 200+ official templates including:

  • Languages: Python, JavaScript, TypeScript, Go, Rust, Java, C++, C#, PHP, Ruby, Swift, Kotlin
  • Frameworks: React, Vue, Angular, Django, Flask, Express, Spring, Laravel
  • Tools: VS Code, JetBrains, Vim, Emacs, Docker, Kubernetes
  • Platforms: macOS, Windows, Linux, Android, iOS
  • And many more...

🤝 Contributing

We welcome contributions! See our Contributing Guide for details.

📄 License

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

🙏 Acknowledgments

  • github/gitignore for the comprehensive template collection
  • The Python community for excellent tooling and libraries
  • All contributors who help make gi better

Ready to get started? Check out our Installation Guide!