3

How can I configure via git-config the unified context so that I don't have to always provide the -U or --unified option with a value?

1 Answer 1

8
git config --global diff.context <value> 

will set it to show <value> lines of context in any repo you work with.

Sign up to request clarification or add additional context in comments.

3 Comments

How would discover this tidbit? For example, I looked in the output of "git help diff" and it did not refer me to any config documentation.
@ChrisCleeland git help config
This configuration option is not available in git 1.7.1. so I had to create an alias around it (I see a gui.diffcontext config option, but setting that makes no difference to the current default of 3 lines.) e.g. git config --global alias.di 'diff --unified=9'

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.