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¶
๐ Prerequisites¶
Before we start, make sure you have:
- โ
giinstalled (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:
You should see something like:
๐ Step 2: Explore Available Templates¶
Let's see what templates are available:
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:
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:
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:
This creates a .gitignore file in your current directory. Let's verify it worked:
๐ Step 6: Combine Multiple Templates¶
Let's create a more comprehensive .gitignore for a full-stack project:
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:
This is equivalent to:
โ๏ธ 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:
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
This creates a .gitignore file that covers all these technologies!
๐ Congratulations!¶
You've successfully:
- โ
Installed and verified
gi - โ Explored available templates
- โ
Created your first
.gitignorefile - โ Combined multiple templates
- โ Used aliases and advanced options
- โ Created a real-world example
๐ What's Next?¶
Now that you know the basics, explore more:
- User Guide - Complete command reference
- Tutorials - Detailed guides
- 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¶
Network Issues¶
๐ก Pro Tips¶
- Use aliases: They're shorter and easier to remember
- Preview templates: Use
gi show <template>before combining - Check results: Always review the generated
.gitignore - Keep it simple: Start with basic templates, add complexity as needed
Ready for more? Check out our Complete Command Reference!