I would like to be able to install a pre-commit hook, but also to be able to commit under certain circumstances (e.g., WIP) even when the hook fails. I can do this easily from the command line, using git commit --no-verify
(git commit -n
). But I can't find anything that allows me to affect the commit in VSCode other than the text field for the commit message.
Am I missing it, or is it not there?
Just enter your commit message and then select Commit All. The equivalent command for this action is git commit -a . Visual Studio also makes it easy to commit and sync with one click by using the Commit All and Push and Commit All and Sync shortcuts.
In the text box write in your commit message (if you're wanting to know how to write better commit messages I found this article helpful). Then click the check mark. In Git this is “git commit -m “Updated project links”: Click on the More Options icon, then select “Push”.
Choose “Open in Default Browser” or “Open in Other Browsers.” If you select the “Open in Default Browser” option, the HTML file will launch in whatever browser is set as default.
The Visual Studio Code editor supports debugging of JavaScript running in Microsoft Edge and Google Chrome. You can read more about debugging browsers works in the Browser Debugging documentation.
Is there a way to instruct Visual Studio Code to skip
git commit
hooks (i.e., to supply the-n
argument)?
Update Sept 2020: there is, with VSCode 1.50 (Sept 2020), which adds the missing option for git commit
in VSCode.
See PR 106335: Adds commands for --no-verify
commit variants
This PR adds
*NoVerify
command variants for creating commits while skipping pre-commit and commit-msg hooks.The commands are only displayed if the
git.allowNoVerifyCommit
option is set to true.
This type of commits requires additional confirmation (likegit.pushForce
does), which can be bypassed by disabling thegit.confirmNoVerifyCommit
option.
See the (now released) VSCode 1.50 "Git: Commit --no-verify commands"
Git commit commands with the
--no-verify
flag are now available after enabling thegit.allowNoVerifyCommit
setting.
Original answer Dec. 2019: From VSCode alone:
extensions/git/src/git.ts
(but its could be amended by a patch, if a contributor might chose to)From a VSCode extension, like GitLens
Go into VSCode settings and enable: git.allowNoVerifyCommit
"git.allowNoVerifyCommit": true
Now you can use the: Commit (No Verify) option through the Source Control panel.
Or you can use it through the Command Palette.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With