- Make sure you have your OpenAI API key set as an environment variable (OPENAI_API_KEY)
- Set up the pre-commit message prep hook bu adding the other two files here in the
./git/hooks
directory.
Test using it by staging some changes to commit and then running git commit in the command line. The file it pops up for you to edit now should have the suggested summary of the changes from the OpenAI api commented out like this:
# Here is a suggested commit message from code-davinci-002.
# ---