gg commit

Core Command

Create commits with enhanced features including AI-generated commit messages.

Usage

bash
gg commit [options] [message]

Description

The gg commit command creates a new commit with your staged changes. It offers several enhancements over standard git commit:

  • AI-Generated Messages: Use the --ai flag to automatically generate meaningful commit messages
  • Interactive Mode: Opens your editor for detailed commit messages
  • Conventional Commits: AI follows conventional commit format (feat, fix, docs, etc.)
  • Multi-line Support: Easily create commits with body and footer

Options

OptionDescription
--aiGenerate commit message using AI
-m, --messageSpecify commit message inline
-a, --allStage all modified files and commit
--amendModify the last commit

Examples

AI-Generated Commit Message

bash
gg commit --ai

Analyzes your staged changes and generates a meaningful commit message following conventional commit format.

Inline Message

bash
gg commit -m "fix: resolve authentication bug"

Stage and Commit All

bash
gg commit -am "docs: update README with examples"

Amend Last Commit

bash
gg commit --amend --ai

Updates the last commit with a new AI-generated message.

AI Commit Messages
GitGuru analyzes your staged changes including file names, diff content, and change patterns to generate contextual, meaningful commit messages that follow best practices.

Conventional Commits

GitGuru's AI generates commit messages following the conventional commits specification:

feat: add user authentication

New features

fix: resolve memory leak in cache

Bug fixes

docs: update API documentation

Documentation changes

refactor: simplify authentication logic

Code refactoring

Best Practices

  • Always review AI-generated messages before committing
  • Make focused commits that represent a single logical change
  • Use conventional commit types for better changelog generation
  • Write descriptive messages that explain "why", not just "what"
  • Keep commit messages under 72 characters for the subject line
While AI-generated messages are helpful, always review and edit them to ensure accuracy and completeness.