Automated git commit messages using GPT models via gptcommit for VS Code.
- Install the extension from the VS Code Marketplace
- Install the gptcommit
Note: Do NOT install gptcommit
hook via gptcommit install
under the root of your git repo.
Run via Ctrl+Shift+P
or Cmd+Shift+P
:
-
GPTCommit: Generate Git Commit Message
Generate the commit message -
GPTCommit: Setup OpenAI API Key
Setup the OpenAI API Key. You can get the API key from OpenAI -
GPTCommit: Try a different OpenAI model
Try a different OpenAI model. For a list of public OpenAI models, checkout the OpenAI docs.
ExpressMode
: If true, generated message will be filled into the Source Control commit message input box directly, instead of opening a new editor.ExpressModeContent
: Content of the message to fill in the express mode.GptcommitPath
: Path to thegptcommit
executable.OnFiles
: Diff of files to use for generating the commit message.staged
: Use staged filesunstaged
: Use unstaged filestryStagedThenUnstaged
: Try staged files first, then try unstaged files if no staged files are found
The configuration is saved at ~/.config/gptcommit/config.json
. You can edit it manually, but it's recommended to use commands inside VS Code to edit the configuration, unless you know what you are doing.
Also refer to the gptcommit documentation for more information.