Save time generating your git commit message
No more time wasted crafting the perfect commit message.
Natt Nguyen·February 13, 2023 (2 years ago)·3 min read
There are only two hard things in Computer Science: cache invalidation and naming things. — Phil Karlton
Developers should have good git commit messages for several reasons:
- Clarity: Good commit messages provide clear and concise information about the changes made in the commit. This makes it easier for other developers to understand what changes were made and why.
- Documentation: Commit messages serve as documentation for the project, allowing developers to understand the history and evolution of the codebase.
- Collaboration: Good commit messages facilitate collaboration between developers by making it easier to track changes and resolve conflicts.
- Debugging: Clear commit messages can help with debugging, as they provide context and information about changes made to the code.
- Code maintenance: Well-written commit messages make it easier to maintain the codebase over time, as they provide a clear record of changes and the rationale behind them.
Developers can now save time by generating your commit message using AI Commits by Hassan El Mghari.
We need a package manager and an Open AI API key. You can find the offical way to install aicommits
here. In this order, we first need to globally install aicommits
.
Then we need a Open AI account to get an API key. After logging in or creating a free account, click on the profile popover on the top right or navigate to this link here.
Make sure you don't share your API key with others, or expose it in the browser or other client-side code. After copy the Open AI API key, paste in this command as so.
Now we are all set up. To use Commit AI, we need to git add all then run the following command in your git workflow:
There are compelling reasons to have good commit messages, especially when working in a team. Commit AI by Hassan El Mghari saves time in generating the perfect commit message.
The commit message for writing and creating this article is "Add files and setup Open AI for Commit AI blog post." How cool is that!
We're finally done writing commit messages.