Skip to content

Instantly share code, notes, and snippets.

View sergebulaev's full-sized avatar

Sergey Bulaev sergebulaev

View GitHub Profile
@sergebulaev
sergebulaev / add_to_zshrc.sh
Last active October 1, 2024 11:25 — forked from karpathy/add_to_zshrc.sh
Git Commit Message AI
# -----------------------------------------------------------------------------
# AI-powered Git Commit Function
# Copy paste this function into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It:
# 1) Checks if there are any staged changes
# 2) Gets the current staged changes diff
# 3) Sends the diff to an LLM to generate a structured summary of changes
# 4) Sends the diff to an LLM to write a git commit message
# 5) Allows you to easily accept, edit, regenerate, or cancel the commit
# 6) Provides timestamp for successful commits or cancellations
#