ai-prepare-commit-msg

Tutorial: Generate Your First Commit Message

In this tutorial, you will configure the hook and complete a commit with an AI-generated message.

When you finish, you will know the complete happy-path workflow.

Before You Begin

Step 1: Install the Hook

Follow How to install using the pre-commit method.

Step 2: Configure Environment Variables

Set the model and provider values you want to use. For example:

export LITELLM_PROXY_MODEL=github_copilot/gpt-4

If your provider needs additional variables, set them now. See Configuration reference.

Step 3: Create a Small Change

Edit any file in your repository, then stage the change:

git add <file>

Step 4: Start the Commit

Run:

git commit

Your editor opens with a generated commit message draft.

Step 5: Review and Finish

Check that the message matches your change intent. Adjust wording if needed, then save and close the editor.

What You Learned

Next Step

Continue with How to use to learn repeatable daily usage.