Basic Usage

Learn the fundamentals of using GitGuru for everyday Git operations.

Getting Help

GitGuru provides comprehensive help for all commands. Use the --help flag to see available options:

bash
# Show all available commands
gg --help

# Get help for a specific command
gg commit --help
gg ask --help

# Check version
gg --version

Natural Language Queries

The most powerful feature of GitGuru is asking questions in plain English. Use gg ask to get Git command suggestions:

bash
# Ask anything about Git
gg ask "undo last commit but keep changes"
gg ask "show me what I changed"
gg ask "create a new branch called feature"

# Skip confirmation with -y flag
gg ask "show last commit" -y
Safety Analysis
Every suggestion from gg ask includes a safety level indicator:
  • 🟢 Safe - Read-only operations, no risk of data loss
  • 🟡 Caution - Modifies working directory but changes are reversible
  • 🔴 Dangerous - Can permanently delete data or rewrite history

Learning Git Concepts

Use gg explain to get comprehensive explanations of any Git concept:

bash
# Explain Git commands
gg explain status
gg explain merge
gg explain rebase

# Explain Git concepts
gg explain "detached HEAD"
gg explain conflict
gg explain stash

# Learn workflows
gg explain "git flow"
gg explain "feature branches"

Checking Repository Status

Use gg status (or shorthand gg s) to see your repository state:

bash
# Basic status
gg status

# Status with AI analysis
gg status --ai

# Shorthand
gg s

The status command shows:

  • Color-coded file status (staged, modified, untracked)
  • Branch information with ahead/behind counts
  • Summary of changes
  • AI recommendations (with --ai flag)

Staging Files

Use gg add (or gg a) for interactive file staging:

bash
# Interactive selection of all changed files
gg add

# Add specific files
gg add file1.ts file2.ts

# Shorthand
gg a
Interactive Selection
When you run gg add without arguments, you'll get a multi-select interface to choose which files to stage.

Committing Changes

Use gg commit to create commits with optional AI-generated messages:

bash
# Interactive commit with AI suggestion
gg commit

# Direct commit with message
gg commit "fix: resolve login bug"

# Force AI generation
gg commit --ai

# Amend last commit
gg commit --amend

Viewing Changes

Use gg diff to see what changed in your files:

bash
# Show all changes
gg diff

# Show staged changes only
gg diff --staged

# Diff for specific file
gg diff --file src/app.ts

# Show statistics only
gg diff --stat

# AI summary of changes
gg diff --ai

Viewing Commit History

Use gg log to view commit history:

bash
# Show last 10 commits
gg log

# Show more commits
gg log -n 20

# Show with visual graph
gg log --graph

# AI analysis of history
gg log --ai

Syncing with Remote

GitGuru provides several commands for working with remote repositories:

bash
# Push changes
gg push
gg push --dry-run  # Preview what will be pushed

# Pull changes
gg pull
gg pull --rebase  # Pull with rebase

# Fetch without merging
gg fetch

# Complete sync (fetch → pull → push)
gg sync
gg sync --rebase

Branch Management

Use gg branch (or gg b) for branch operations:

bash
# Interactive branch selector
gg branch

# Create new branch
gg branch -c feature/login

# Delete branch
gg branch -d old-feature

# Shorthand
gg b

Command Shortcuts

GitGuru provides shortcuts for commonly used commands:

ShorthandFull CommandDescription
gg sgg statusRepository status
gg agg addStage files
gg bgg branchBranch management
gg pgg pushPush to remote

Next Steps

Now that you understand the basics, explore these topics: