Skip to content

First Steps

Welcome to gi! This guide will walk you through your first steps with the .gitignore combiner.

๐ŸŽฏ What is gi?

gi is a command-line tool that helps you create comprehensive .gitignore files by combining official templates from github/gitignore. Instead of manually copying and pasting ignore rules, gi does it automatically and intelligently.

๐Ÿš€ Why Use gi?

Before gi

# Manual process - time consuming and error-prone
# 1. Go to github.com/github/gitignore
# 2. Find Python template
# 3. Copy content
# 4. Find Node.js template  
# 5. Copy content
# 6. Manually combine and deduplicate
# 7. Save as .gitignore

With gi

# One command - fast and reliable
gi main python node

๐Ÿ“‹ Prerequisites

Before we start, make sure you have:

  • โœ… gi installed (see Installation Guide)
  • โœ… Basic familiarity with command line
  • โœ… A project directory to work with

๐Ÿ Step 1: Verify Installation

First, let's make sure gi is working:

gi --version

You should see something like:

gi version 0.1.0

๐Ÿ” Step 2: Explore Available Templates

Let's see what templates are available:

# List all templates
gi list

This shows you all 200+ available templates. You'll see output like:

Available .gitignore Templates
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Template Name         โ”ƒ Category           โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ Python               โ”‚ Language/Framework โ”‚
โ”‚ Node                 โ”‚ Language/Framework โ”‚
โ”‚ React                โ”‚ Language/Framework โ”‚
โ”‚ Django               โ”‚ Language/Framework โ”‚
โ”‚ Flask                โ”‚ Language/Framework โ”‚
โ”‚ ...                  โ”‚ ...                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ”Ž Step 3: Search for Templates

Let's search for templates related to Python:

gi search python

This will show templates that match "python":

Search Results for "python"
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Template Name         โ”ƒ Category           โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ Python               โ”‚ Language/Framework โ”‚
โ”‚ Django               โ”‚ Language/Framework โ”‚
โ”‚ Flask                โ”‚ Language/Framework โ”‚
โ”‚ Jupyter              โ”‚ Language/Framework โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ‘€ Step 4: Preview a Template

Before using a template, let's see what's in it:

gi show Python

This shows the raw content of the Python template:

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
...

๐ŸŽฏ Step 5: Create Your First .gitignore

Now let's create a .gitignore file for a Python project:

# Create a Python .gitignore
gi main python

This creates a .gitignore file in your current directory. Let's verify it worked:

# Check if file was created
ls -la .gitignore

# View the content
head -20 .gitignore

๐Ÿ”„ Step 6: Combine Multiple Templates

Let's create a more comprehensive .gitignore for a full-stack project:

# Python backend + Node.js frontend
gi main python node

This combines both Python and Node.js ignore rules into one file.

๐ŸŽจ Step 7: Use Convenient Aliases

gi includes aliases to make common combinations easier:

# Use aliases instead of full names
gi main python node vscode

This is equivalent to:

gi main Python Node "Global/VisualStudioCode"

โš™๏ธ Step 8: Customize Output

Let's try some advanced options:

# Save to a specific file
gi main python rust -o my-project/.gitignore

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

# Force overwrite without prompting
gi main python node --force

๐Ÿ” Step 9: Get Diagnostic Information

Check the status of your gi installation:

gi doctor

This shows information about: - Cache status - Available templates - Configuration - Network connectivity

๐ŸŽฏ Step 10: Real-World Example

Let's create a .gitignore for a real project. Imagine you're building a web application with:

  • Python backend (Django)
  • Node.js frontend (React)
  • VS Code for development
  • Docker for containerization
# Create comprehensive .gitignore
gi main python django node react vscode docker

This creates a .gitignore file that covers all these technologies!

๐ŸŽ‰ Congratulations!

You've successfully:

  • โœ… Installed and verified gi
  • โœ… Explored available templates
  • โœ… Created your first .gitignore file
  • โœ… Combined multiple templates
  • โœ… Used aliases and advanced options
  • โœ… Created a real-world example

๐Ÿš€ What's Next?

Now that you know the basics, explore more:

  1. User Guide - Complete command reference
  2. Tutorials - Detailed guides
  3. Advanced Usage - Power user features

๐Ÿ†˜ Common Issues

Template Not Found

# If a template isn't found, search for it
gi search <partial-name>

# Or list all to see exact names
gi list

Permission Errors

# Make sure you have write permissions in the directory
ls -la .  # Check permissions

Network Issues

# gi works offline with cached templates
gi doctor  # Check cache status

๐Ÿ’ก Pro Tips

  1. Use aliases: They're shorter and easier to remember
  2. Preview templates: Use gi show <template> before combining
  3. Check results: Always review the generated .gitignore
  4. Keep it simple: Start with basic templates, add complexity as needed

Ready for more? Check out our Complete Command Reference!