Skip to main content

Automatically generate and commit changes using copilot

Project description

git-copilot-commit

AI-powered Git commit assistant that generates conventional commit messages using GitHub Copilot.

Features

  • Generates commit messages based on your staged changes
  • Supports multiple AI models: GPT-4, Claude, Gemini, and more
  • Allows editing of generated messages before committing
  • Follows the Conventional Commits standard

Installation

Install with uv (recommended):

uv tool install git-copilot-commit

Or with pipx:

pipx install git-copilot-commit

Or run directly with uv:

uvx git-copilot-commit --help

Prerequisites

  • Active GitHub Copilot subscription

Quick Start

  1. Authenticate with GitHub Copilot:
git-copilot-commit authenticate
  1. Make changes in your repository.

  2. Generate and commit:

git-copilot-commit commit

Usage

Commit changes

git-copilot-commit commit

Options:

  • --all, -a: Stage all files
  • --verbose, -v: Show detailed output
  • --model, -m: Choose an AI model

Workflow:

  1. Analyze changes
  2. Prompt to stage files
  3. Generate a commit message
  4. Choose to commit, edit, or cancel

Authenticate

git-copilot-commit authenticate

List models

git-copilot-commit models

Configure

git-copilot-commit config --show
git-copilot-commit config --set-default-model gpt-4o

Examples

Commit all changes:

git-copilot-commit commit --all

Verbose output:

git-copilot-commit commit --verbose

Use a specific model:

git-copilot-commit commit --model claude-3.5-sonnet

Set and use a default model:

git-copilot-commit config --set-default-model gpt-4o
git-copilot-commit commit
git-copilot-commit commit --model claude-3.5-sonnet

Commit Message Format

Follows Conventional Commits:

<type>[optional scope]: <description>

Types:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation
  • style: Formatting only
  • refactor: Code restructure
  • perf: Performance
  • test: Tests
  • chore: Maintenance
  • revert: Revert changes

Examples:

  • feat(auth): add JWT authentication
  • fix(db): retry connection on failure
  • docs(readme): update install steps
  • refactor(utils): simplify date parsing

Git Configuration

Add a git alias by adding the following to your ~/.gitconfig:

[alias]
    ai-commit = "!f() { git-copilot-commit commit $@; }; f"

Now you can run:

git ai-commit
git ai-commit --model claude-3.5-sonnet
git ai-commit --all --verbose

Show more context in diffs:

git config --global diff.context 3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_copilot_commit-0.1.8.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_copilot_commit-0.1.8-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file git_copilot_commit-0.1.8.tar.gz.

File metadata

  • Download URL: git_copilot_commit-0.1.8.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.22

File hashes

Hashes for git_copilot_commit-0.1.8.tar.gz
Algorithm Hash digest
SHA256 97d214db7bc11e69564c9b8247165c0bbc37a0feb2cc817e8d2db3e14d8150be
MD5 7b6d190f1c987a73e7cde7b981f32cde
BLAKE2b-256 7dbe4634ca1160cd1f323cab5c222410160429da555475b7a3f15fd33ae5a9d4

See more details on using hashes here.

File details

Details for the file git_copilot_commit-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for git_copilot_commit-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 2832d60967b5a4a2d591537318c187303131692283fed13e50650242b6e538f3
MD5 2160437105f3e704190118a6699cfa0e
BLAKE2b-256 f2a85315eb0978ff17b560f31ac52ff6b7143371753a1bb54bf1c0d1f99f9fdd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page