Skip to content

Commit

Permalink
fix: add info about AI commit msg variables (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndom91 authored Jul 27, 2024
1 parent 1b27980 commit ecdddc8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions content/docs/features/virtual-branches/commits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GitButler has lots of ways to craft the exact commits that you want to end up wi
Here are some of the cool things you can do very easily with GitButler.

## Creating Commits
Once you have changes on a virtual branch and want to commit them, you can hit the "Start Commit" button, which gives you an editor to write a summary and optional description for your commit message.
Once you have changes on a virtual branch and want to commit them, you can hit the "Start Commit" button, which gives you an editor to write a summary and optional description for your commit message.

If you want AI to use your diff to generate a commit message, you can hit the "Generate message" button.

Expand All @@ -26,7 +26,7 @@ If you want AI to use your diff to generate a commit message, you can hit the "G

## AI Commit Message Settings

If you want to use AI for generating your commit messages from time to time, you there are quite a few options in your user preferences. You can choose from [OpenAI](https://platform.openai.com/), [Anthropic](https://www.anthropic.com/) or [Ollama](https://www.ollama.com/) as your engine.
If you want to use AI for generating your commit messages from time to time, you there are quite a few options in your user preferences. You can choose from [OpenAI](https://platform.openai.com/), [Anthropic](https://www.anthropic.com/) or [Ollama](https://www.ollama.com/) as your engine.

For both OpenAI and Anthropic, you can either use your own API key to directly send your request to their servers, or you can proxy via our server (which you need to be logged in for).

Expand Down Expand Up @@ -60,9 +60,15 @@ With all of these models, you can also customize the prompt if you want somethin
src="/img/docs/commits-04.avif"
/>

Custom prompts can contain three variables which we will replace with the appropriate values. Those include:

- `%{emoji_style}` - Instructs the LLM whether or not to make use of [GitMoji](https://gitmoji.dev) in the title prefix, based on your settings.
- `%{brief_style}` - Instructs the LLM to not exceed 1 sentence when generating the commit message.
- `%{diff}` - The contents of the diff.

## Absorbing New Work

If you have a commit and get some feedback on it or find an issue and wish to amend it, you can very easily absorb changes into existing commits. Simply drag the file into the commit you want to absorb that change into and drop it there.
If you have a commit and get some feedback on it or find an issue and wish to amend it, you can very easily absorb changes into existing commits. Simply drag the file into the commit you want to absorb that change into and drop it there.

This will both rewrite that commit to include the new changes and also rebase every commit upstream from it automatically.

Expand Down

0 comments on commit ecdddc8

Please sign in to comment.