Home > Mobile >  Is there a way to have VSCode git commit default to "git commit -a"?
Is there a way to have VSCode git commit default to "git commit -a"?

Time:01-12

Is there some way of forcing the commit button in the VSCode UI to always peform "git commit -a"?

A partial solution consists in enabling "smart commit", so that when no changes are staged, it does a "git commit -a". This almost works, except that it doesn't when new files are created. One adds the file to git, at which point there is some change staged, and the commit button then performs as a "git commit" rather than "git commit -a".

Is there a way to have always "git commit -a" be the behavior?

And on a related note, is it possible to have VSCode ask whether to add new files to git?

CodePudding user response:

It is not a button, but VSCode does include the command: Git: commit (All), that you can then associate to a keyboard shortcut.

If not, you need to click on "Stash All Changes", then "Commit":

stash all

  • Related