Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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!

share|improve this question
add comment

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.

share|improve this answer
add comment

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
add comment

Your Answer

 
discard

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.