Write Your Git Commits with GitHub Copilot - Visual Studio Blog (original) (raw)
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 suggestions
To 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.
Author

Jessie is a Product Manager on the Visual Studio version control team, focusing on transforming the developer expereince with GitHub Copilot.


