Last active
September 30, 2024 12:43
-
-
Save voodoohop/dc362804e835f3d2582734976589665f to your computer and use it in GitHub Desktop.
One-Liner Using ChatGPT for Concise, Automated Git Commit Messages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install | |
pip install shell-gpt | |
sgpt "hi" (and enter your API key) | |
# commit the current folder with the generated message | |
git commit . -m "$(git diff | sgpt --model gpt-4o --code 'Write concise, informative commit messages: Start with a summary in imperative mood, explain the 'why' behind changes, keep the summary under 50 characters, use bullet points for multiple changes, avoid using the word refactor, instead explain what was done, and reference related issues or tickets. What you write will be passed to git commit -m "[message]"')" | |
# you could assign an alias now if you like it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment