DEV Community

Evan Lin
Evan Lin

Posted on • Originally published at evanlin.com on

GitHub Copilot: Make Your Commit Messages More Engaging with Custom Instructions

title: [Github Copilot] Make Your Github Copilot Commit Messages More Lively with Custom Instructions
published: false
date: 2025-01-02 00:00:00 UTC
tags: 
canonical_url: https://www.evanlin.com/til-copilot-commit-msg/
---

![Google Chrome 2025-01-02 14.47.20](https://www.evanlin.com/images/2022/Google%20Chrome%202025-01-02%2014.47.20.png)

# Background:

Those who know me know that I am a big fan of Github Copilot (because of open-source projects, I got it for free, although it is now open for [free usage](https://docs.github.com/en/copilot/managing-copilot/managing-copilot-as-an-individual-subscriber/about-github-copilot-free)).

The most frequently used feature is the automatic Commit Message function, which saves me from having to think about what I changed or what rules to use when writing.

# The Problem with the Current Standard Github Copilot Messages

However, if you want to create some special Commit Messages, for example:

![image-20250102164133473](https://www.evanlin.com/images/2022/image-20250102164133473.png)

Or even more lively, using the so-called "[emoji commit message](https://gist.github.com/parmentf/035de27d6ed1dce0b36a)":

![Google Chrome 2025-01-02 16.42.48](https://www.evanlin.com/images/2022/Google%20Chrome%202025-01-02%2016.42.48.png)

But the original format provided by Github Copilot is quite standard, how can we modify it?

# Customizing Commit Messages (Custom instructions for GitHub Copilot)

In December 2024, Github released a new setting ([Custom instructions for GitHub Copilot](https://code.visualstudio.com/docs/copilot/copilot-customization)) that allows you to make your Commit Messages more unique through settings.

Enter fullscreen mode Exit fullscreen mode

"github.copilot.chat.testGeneration.instructions": [
{
"text": "Always use vitest for testing React components."
},
{
"text": "Use Jest for testing JavaScript code."
},
{
"file": "code-style.md" // import instructions from file code-style.md
}
],


Here is an example that can quickly transform your Commit Messages into a richer format.

Quickly modify the format of github copilot commit msg:

1. Open vs code via [vscode://settings/github.copilot.chat.commitMessageGeneration.instructions](vscode://settings/github.copilot.chat.commitMessageGeneration.instructions)

2. Add

Done. It looks great like this :)

![Slack 2025-01-02 16.21.05](https://www.evanlin.com/images/2022/Slack%202025-01-02%2016.21.05.png)
Enter fullscreen mode Exit fullscreen mode

Top comments (0)