After spending hours on a bug fix or a feature update, often the last thing we developers want to do is carefully explain the contents of the Git commit. The latest Visual Studio preview is here to help. Use the new generated Git commit message feature to help you describe your set of changes. You can then refine the message with “why” the change was made and commit.
Generating useful and informative commit messages helps you in a variety of ways.
- You avoid your repository looking like this
- Your teammates can more effectively review your changes in a pull request
- Your Git history tells a story that includes both “what” was changed and “why”
- You can easily pinpoint the origins of a bug or breaking change
- You save yourself and/or coworkers hours of digging around while troubleshooting
- You make your repository easier to ramp up to and contribute to in the future
Enable the feature
This feature is currently only available in preview. Ensure it’s enabled in Tools > Options > GitHub > Copilot chat > Enable commit message suggestionsTo try it out, download the latest Visual Studio preview and update the GitHub Copilot Chat Extension. You’ll also need an active GitHub Copilot subscription.
What is the generated Git commit message feature?
The new Generated Commit Message feature uses GitHub Copilot AI to describe your code changes. This makes writing descriptive and helpful commit messages as easy as clicking a button, then adding your explanation.
Use the new “Add AI Generated Commit Message” sparkle pen icon in the Git Changes window to generate a suggestion. GitHub Copilot will look at the file changes in your commit, summarize them, and then describe each change. You can then “Insert AI Suggestion” or “Discard.”
Let us know what you think
We hope this new feature makes writing your Git commit messages easier – leading to productivity for you, your teammates, and even “future you” when reviewing your changes and helping others understand your Git history. Share your thoughts with us, so we can continue to improve your experience.
We appreciate the time you’ve spent reporting issues/suggestions and hope you continue to give us feedback when using Visual Studio on what you like and what we can improve. Your feedback is critical to help us make Visual Studio the best tool it can be! You can share feedback with us via Developer Community: report any bugs or issues via report a problem and share your suggestions for new features or improvements to existing ones.
Stay connected with the Visual Studio team by following us on YouTube, Twitter, LinkedIn, Twitch and on Microsoft Learn.
I was really eager to try this, but I am really disappointed since the text generated is WAY too long. It should be limited to 1-3 lines. Or we should be able to insert our own prompt in settings of the extension. Is there anywhere I can request a feature request for the extension?
You can upvote this item on the roadmap – https://developercommunity.visualstudio.com/t/Shorten-the-output-from-AI-generated-Git/10536558
I know that this is the visual studio blogs but does anyone know if this is possible to use this feature from the CLI? I love VSCode and GitHub Copilot but I still do most of my commits and git management in the terminal as I feel like I am faster that way. I would absolutely love to use this feature however.
Looking forward to a reply!
Hi Ricardo, VSCode made this announcement last week – https://twitter.com/code/status/1745164198282236295
May i know how many code data (or it is just limited to current section for code diff?) was sent to the AI engine (is the AI engine cloud base or running under our local machine?) for generating and analysis the commit changes?
Hi Jessie, I am excited to use this feature, but cannot get the 'sparkle' button to show up in the commit message window. I have installed Visual Studio 17.9.0 Preview 1.1 (which is the lastest as of this post), and followed all of the instructions here to get the feature enabled. I have both GitHub Copilot and GitHub Copilot chat extensions installed. I know Copilot is working because I use it for suggestions when coding....
I have the same issue.
Hi @Stephen Miller and @Niels van Strien, We’ve made a fix that shipped yesterday to resolve an issue similar to what you are reporting – https://developercommunity.visualstudio.com/t/How-do-I-enable-GitHub-Copilot-Commit-Me/10528699. Please follow up in that ticket if the issue persists after updating.
A good idea is not to allow the generic AI one, at least 30% of it must be by hand
This is real close! However, commit messages should follow the 50/72 rule. If it’s going to be automated with copilot, the 50/72 rule should be added to its instruction prompt.
As it is, if my team were to use commit messages like the example above, the code history will become unnavigable over time.
That seems like a little more than 50 characters.
A good place for such detailed explanation is PR description, not commit message.
Uhm… The title that is three lines long? No thanks
Can I generate in my native language, such Chinese?
Because this is supported by Copilot chat, and the responses are currently limited to English, we cannot support other languages, yet. Please suggestion a feature on Developer Community to help collect community support for this suggestion.