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?

Thanks!

link|improve this question
feedback

2 Answers

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.

link|improve this answer
feedback

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).

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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