Summary: In this step, you'll learn how to use GitHub Copilot to automatically generate meaningful commit messages based on your code changes and to perform code reviews before committing. These features help improve your Git workflow and maintain high code quality.
Let's use GitHub Copilot to generate a commit message for the accessibility improvements you've made:
-
Open the Source Control view in VS Code by clicking the Git icon or pressing
Ctrl+Shift+G(Cmd+Shift+Gon macOS). -
Stage your changes by clicking the
+icon next to the modified files or using the "Stage All Changes" option. -
Click the GitHub Copilot icon in the commit message input area (looks like a sparkle or AI icon).
-
Wait for Copilot to analyze your changes and generate a commit message automatically. The message will appear in the commit input field.
-
Review and edit the generated message if needed. Even with AI assistance, it's good practice to verify the message accurately reflects your changes.
-
Complete the commit by clicking the checkmark icon or pressing
Ctrl+Enter(Cmd+Enteron macOS).
Example of a generated commit message
Improve accessibility in StudyPlan AI dashboard
- Add semantic HTML5 landmarks (header, nav, main, footer)
- Make all interactive elements keyboard accessible
- Add proper ARIA attributes to icons and UI components
- Improve form field labeling and associations
- Add status message announcements for screen readers
These changes ensure WCAG 2.1 AA compliance and improve the experience for users with disabilities.
Before finalizing your commit, use GitHub Copilot to review your code changes:
-
Open the Command Palette with
Ctrl+Shift+P(Cmd+Shift+Pon macOS). -
Search for "GitHub Copilot: Review Changes" and select it.
-
Wait for Copilot to analyze your changes and provide feedback on potential issues or improvements.
-
Review the suggestions provided by Copilot, which may include potential bugs or logic errors, accessibility issues, performance optimizations, security vulnerabilities, and code style improvements.
-
Address any relevant suggestions before proceeding with your commit.
-
Generate a new commit message that reflects any additional improvements you've made.
-
Always review the generated commit messages before committing to ensure accuracy.
-
Add context when needed - AI may not understand the "why" behind certain changes.
-
Consider Copilot's code review as a complementary tool - it doesn't replace human code review.
-
Combine with accessibility checks from the previous step for comprehensive quality assurance.
-
Use these features consistently to build good development habits.
| ← Creating Custom Chat Modes for Accessibility Testing | Next: Review and next steps → |
|---|


