Generate Custom Commit Messages with GitHub Copilot in VS Code
One of the most useful features GitHub Copilot supports in Visual Studio Code is generating commit messages. They can be created with a single click and further customized if needed.
Customization of Commit Messages in VS Code
Click the gear icon and select Settings. In the search field, type commit messages. The very first option correctly points to the settings.json
file, where you can define a custom commit message.

In JSON you can now configure a field with instructions. There are two options:
- set the text directly { "text": "instructions" }
- set a file reference { "file": "instructions.md" }
From my experience, writing the instructions directly as text is more reliable. Here’s what my favorite instruction looks like:
First summarize the purpose of the commit briefly, then list the key changes as bullet points. Do not include file names in the commit message. Use english language.
Generating a Commit Message
The second step is simple. Just click the icon in the Message box when creating a commit.

And here we go. Here’s an example of my generated commit message:
Enhance pricing section layout and content in App component
- Increased max width of pricing section for better visibility
- Added new cards for corporate training and online training
- Updated training location description for clarity
- Included a call-to-action button for sending inquiries
- Added details for upcoming online training session
Example of generated commit message
Do you already know this feature? Have you tried it out? Share your experience in the discussion.