Writing meaningful commit messages is a crucial part of software development, but if you're like me, the default commit message generation experience in Visual Studio Code (VSCode) using Copilot might feel less than ideal.
Credit: Foyzul Karim. "Improving Commit Message Quality in VSCode with Copilot"
Note: Add diff.txt to .gitignore so it will not be checked in commit.
git diff > diff.txt-
Open
diff.txtin editor. -
Open
Copilot Chat, make sure theCurrent file contextisdiff.txt. -
Type the following message in the chat window:
write commit message base on this file, follow the AngularJS Git Commit Message Conventions without <scope> and 50/72 rule, capitalize subject, use list style in description when needed
-
Check/Edit the generated commit message in the chat window.
-
Left
Messagefield empty and click theCommitbutton, this will open theCommit Messagewindow. -
Paste the generated commit message in the
Commit Messagewindow. -
Save and close the
Commit Messagewindow.