Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub Copilot is ignoring commit message generation instructions in workspace settings in VS Code

I'm using GitHub Copilot to generate commit messages. I'm not happy with the message it generates automatically by default on click of this "Generate Commit Message with Copilot" button.

Generate Commit Message with Copilot

So I followed the docs and did the setup in my repo as follows.

commit-message.md:

Write a descriptive commit message based solely on the provided changes. Follow these strict rules:


Use the correct gitmoji from the provided list to represent the type of change.
Separate subject from body with a blank line.
Use the body to explain what and why you have done something. In most cases, you can leave out details about how a change has been made.
In the body, use bullet points to describe everything.
Avoid vague terms like "update", "enhance", "improve", or "better".
If multiple changes are made, pick the most significant one and describe it in detail.
Message length is maximum 250 characters.
gitmojis:


🚧: Work in progress.
⚡️: Improve performance.
🐛: Fix a bug.
✨: Introduce new feature.
📝: Add or update documentation.
🚧: Work in progress.
✅: Add, update, or pass tests.
🔒️: Fix security issues.
♻️: Refactor code.

Workspace settings.json:

{
    "github.copilot.chat.commitMessageGeneration.instructions": [
        {
            "file": "copilot/commit-message.md"
        },
        {
            "text": "Always add a comment: 'Generated by Copilot'."
        }
    ],
    "github.copilot.chat.agent.runTasks": true
}

Setup Screenshot

Now when I click on "Generate Commit Message" button, the instructions are ignored and a simple message is generated.

Actual Message Generated

I tried restarting VS Code and even my machine. But still getting the same result. So when I checked the settings from Settings UI. I noticed that its under "Experimental".

Settings UI

I'm running the latest version of VS Code, GitHub Copilot extensions.

VS Code:

VS Information

Extensions:

Extensions

Do I need to enable any extra settings? I'm not able to find anything in docs either.

like image 798
fingers10 Avatar asked Apr 10 '26 15:04

fingers10


1 Answers

I figured it out. The issue is with the path. Notice the ./ prefix in file path. That solved it.

{
    "github.copilot.chat.commitMessageGeneration.instructions": [
        {
            "file": "./copilot/commit-messages.md"
        },
        {
            "text": "Generated by Copilot."
        }
    ]
}
like image 94
fingers10 Avatar answered Apr 13 '26 05:04

fingers10



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!