Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure options for the Version Control's git commit command

Is it possible to options for the Version Control's git commit command? If so, how? I'm a heavy user of the integrated source control UI in VS Code and I often need to provide extra options like --no-verify to the git commit. I still didn't figure out a way of doing this in VS Code.

Thanks!

like image 716
Pedro Mendes Avatar asked Oct 25 '18 10:10

Pedro Mendes


People also ask

What is the git command to set configuration options?

The git config command is a convenience function that is used to set Git configuration values on a global or local project level. These configuration levels correspond to . gitconfig text files. Executing git config will modify a configuration text file.

What is the command to see the available options for the commit command?

The "-m" option allows you to write the message in-line with the "commit" command, instead of first opening the message interface, writing the message, and saving and quiting the message interface.

How do I find my git config details?

Show global git config settings But at runtime, only the value set locally is used. If you would like to delete or edit a Git config value manually with a text editor, you can find the Git config file locations through the Git config list command's –show-origin switch.


1 Answers

With VSCode 1.50 (Sept 2020), there should now be more 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 (like git.pushForce does), which can be bypassed by disabling the git.confirmNoVerifyCommit option.

https://camo.githubusercontent.com/5c42dec32f31c5083e24299459693d5c9e5c9579/68747470733a2f2f692e696d6775722e636f6d2f585138304c57592e706e67


As illustrated with issue 110452, commit --no-verify will be in VSCode 1.52 (Nov. 2020)

Once you enablegit.allowNoVerifyCommit, a bunch of commands will be available:

https://user-images.githubusercontent.com/22350/98923649-38d3bf80-24d4-11eb-955a-5c9560dfbf76.png

like image 152
VonC Avatar answered Sep 26 '22 14:09

VonC