Skip to content

Instantly share code, notes, and snippets.

@nikolaydubina
nikolaydubina / git_commit_ollama.sh
Last active October 8, 2024 19:28 — 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
# based on https://gist.github.com/karpathy/1dd0294ef9567971c1e4348a90d69285
gcm() {
# Function to generate commit message