Skip to content

An AI-powered Git extension that generates commit messages using OpenAI's gpt-4-turbo-preview, streamlining the commit process and improving developer productivity.

laststance/git-commit-gpt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Original package doesn't work due to config mistake 'package.json'. https://github.com/nooqta/git-commit-gpt
Tharefore I fix it and republish as a '@laststance/git-gpt-commit'.

Git Commit GPT-4-turbo-preview

An AI-powered Git extension that generates commit messages using OpenAI's GPT-3.5-turbo-instruct, streamlining the commit process and improving developer productivity.

Installation

There are two ways to install the Git extension: using npm or manual installation.

  • Step1: run the following command:
npm install -g @laststance/git-gpt-commit
  • Step2: move to any languege your project root
cd my-rust-project
  • Step3: add .env file to .gitignore
echo -e "\n.env" >> .gitignore
  • Step4: commit .gitignore
git add .
git commit -m 'add .env to .gitignore'

❗️Step3 and 4 must be done for prevent leak your OpenAI API key on Github/GitLab.

  • Step5: Get your openai API key from openai and add .env file to OPENAI_API_KEY.

.env

OPENAI_API_KEY=your_openai_api_key

✅ You've completed all setup!

Usage

After setting up the project, you can use the Git extension in any Git repository:

Stage your changes:

git add .

Run the Git extension:

git gpt commit

The script will summarize the Git changes since the last commit and generate a commit message using gpt-4-turbo-preview. You will be prompted to confirm whether to use the suggested message or cancel the commit.

Credits

Thanks to

License

This project is licensed under the MIT License.

About

An AI-powered Git extension that generates commit messages using OpenAI's gpt-4-turbo-preview, streamlining the commit process and improving developer productivity.

Topics

Resources

Stars

Watchers

Forks