Skip to content

Instantly share code, notes, and snippets.

@aramnhammer
aramnhammer / add_to_zshrc.sh
Last active August 29, 2024 05:57 — forked from karpathy/add_to_zshrc.sh
Git Commit Message AI
# -----------------------------------------------------------------------------
# AI-powered Git Commit Function
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It:
# 1) gets the current staged changed diff
# 2) sends them to an LLM to write the git commit message
# 3) allows you to easily accept, edit, regenerate, cancel and commit and push
gcm() {
# Function to generate commit message
generate_commit_message() {