Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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

A git-interfaced tool written in Python breaks because of some settings in my local ~/.gitconfig, namely diff.noprefix=True.

I know that I can use something like git -c diff.noprefix=False diff in the call but I fear other things will break in other parts of the tool or on other setups. I have been looking for a --norc or -c /dev/null parameter but didn't find my way in the documentation.

share|improve this question
Sigh. This is why programs built on Git should always use its “plumbing” interface (e.g. git diff-files, git diff-index, and git diff-tree) and not the “porcelain” interface (e.g. git diff). The plumbing commands disregard user-preference items like diff.noprefix, so the output formats are stable (across Git versions and also users). – Chris Johnsen Aug 7 '12 at 3:59

Export a different value for HOME than your normal home directory. Git won't be able to find a ~/.gitconfig there (or can find a new one you define, which is missing the offensive parameter). Looks like you can also set a GIT_CONFIG_NOSYSTEM export to decline usage of /etc/git.config, too.

Further details in this gmane thread.

share|improve this answer

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.