How can I make a Git command temporarily ignore my ~/.gitconfig
?
I can set GIT_CONFIG=/dev/null
to make git config
ignore ~/.gitconfig
, but this doesn't affect other Git commands.
I can hide my ~/.gitconfig
, e.g. mv ~/.gitconfig{,.hidden}
, but this is annoying since I have to move it back later and it affects Git globally.
Use Cases
- Scripting Git: restrict to default settings for portability.
- Debugging Git: restrict to default settings for reproducibility.
git
which would make it ignore the config(s). Maybe you should submit a request to the Git maintainers to include that possibility.git --gitconfigfile=~/.gitconfig_temp diff