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.

Poor Git history example

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.

generated Git commits with GitHub Copilot

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.”

generated Git commits with GitHub Copilot suggestion

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 Houghton

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