I have case where running some git related tests could generate failures if the user running them has some custom hooks installed inside his ~/.git-template/hooks
folder.
Mainly I do want to find a way to run git
commands in insolation, where git would skip using the default hooks and maybe even loading other global configs.
To ignore the system config file (/etc/gitconfig), you can set the environment variable GIT_CONFIG_NOSYSTEM
to 1
/true
/yes
before running your command.
e.g. GIT_CONFIG_NOSYSTEM=true git <command>
https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables
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