Generating commit message via GitLens and Copilot
Post created: Thu, 14 Nov 2024 21:00:00 +0800Background
I have recently discovered a nice feature for GitLens integration on GitHub Copilot, that lets you generate commit messages using o1-preview
or o1-mini
without the need of typing them.
Emm wait, isn’t GitHub Copilot already have such feature?
Yes, but it turns out that the extension uses GPT-4o
models by default (source: trust me bro), and seems like there is no way to change it. If you want to use more advanced model (e.g. o1
family from OpenAI), you can follow my steps. (Notify me if there is indeed a way!)
This is how to use the feature:
Install GitLens extension and GitHub Copilot extension
Update (Nov 20, 2024): You need to switch GitLens to Pre-release edition after you have installed it to work with Copilot extension.
- Make changes by code something new
- Proceed to
Source Control
(pressCtrl+Shift+G
, followed byG
), hover on theSOURCE CONTROL
collapsable menu, and click the three horizontal dot button (More Actions...
) - Click “Generate Commit Messages (GitLens)”
- Choose a model you like
- Wait, if you use
o1
models, it will take a long time
Result
This is what o1-preview
gives me:
Add guide on generating commit messages with GitLens
- Introduce a blog post explaining how to use GitLens and GitHub Copilot to automatically generate commit messages without typing.
- Include screenshots and update CSS to enhance image display.
- Organize image assets and update references for better structure.