Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to run git commands without using the default gitconfig?

For example, say I had setup a custom diff tool in my gitconfig. If I wanted to use the default git diff (which uses diff?), how would I do it?


share|improve this question
up vote 2 down vote accepted

Use the --ext-diff option with git diff. --ext-diff allows you to specify a different external diff tool.

share|improve this answer

To ignore the system Git config (/etc/gitconfig), set the environment variable GIT_CONFIG_NOSYSTEM to 1 (or true or yes). To ignore the global Git config (~/.gitconfig), set the environment variable GIT_CONFIG_NOGLOBAL to 1 (or true or yes).

Example: GIT_CONFIG_NOGLOBAL=1 git diff

These options are available since ab88c36 (allow suppressing of global and system config, 2008-02-06). The first release (candidate) that appears to know them is 1.5.5-rc0 (git describe --contains ab88c36).

share|improve this answer
This was removed in 2011 but HOME= git diff will prevent Git from reading $HOME/.gitconfig, accomplishing the same thing (tested in Git v2.3.2). – Han May 6 '15 at 1:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.