Skip to content

Effortless Git Commits with GPT πŸ‹πŸΌβ€β™‚οΈ

Notifications You must be signed in to change notification settings

ofirsteinherz/gpit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

47 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GPiT

Effortless Git Integration with GPT-Powered Commit Assistance

Overview

This tool is designed to automate several common Git operations, enhancing the standard Git workflow with additional features. It helps in managing unpushed commits, checking for local changes, generating commit messages using OpenAI's GPT-4 API, editing commit messages, and handling the push operation to a remote repository.

Watch.GPIT.in.action.mov

Features

  • πŸ” Check for Unpushed Commits: Quickly identify any commits that haven't been pushed to the remote repository.
  • πŸ“ Detect Local Changes: View a summary of local changes that are not yet committed.
  • πŸ’¬ Generate Commit Messages: Utilizes GPT-4 to suggest commit messages based on the detected changes.
  • ✏️ Edit Commit Messages: Offers an interactive editor for customizing commit messages.
  • πŸš€ Stage, Commit, and Push: Automates the process of staging changes, committing them with a chosen message, and pushing to the remote repository.

Installation

GPIT can be installed directly from PyPI:

pip install gpit

This tool requires Python 3.x. Make sure you have Python installed on your system.

Setting Up OpenAI API Key

Before using the tool, make sure to set your OpenAI API key as an environment variable:

export OPENAI_API_KEY='your_openai_api_key'

Alternatively, you can set it in a .env file in the same directory as the script. The most recommended way to save the key is through "Shell Profile Files": Open or create the .bashrc file:

nano ~/.bashrc

Add your export statement:

export OPENAI_API_KEY="your_openai_api_key_here"

Save and exit. Apply the changes:

source ~/.bashrc

Verifying the Variable:

echo $OPENAI_API_KEY

Usage

Once installed, you can run GPIT from any Git repository on your system. Simply use the following command:

gpit

Follow the on-screen prompts to manage your Git operations.

Dependencies

  • Git
  • Python 3.x
  • Requests library for Python
  • python-dotenv (for managing environment variables)

Install Python dependencies using:

pip install requests python-dotenv

Contributing

Contributions to this project are welcome! Please fork the repository and submit a pull request with your proposed changes.

About

Effortless Git Commits with GPT πŸ‹πŸΌβ€β™‚οΈ

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published