2

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?

bitcycle
  • 7,632
  • 16
  • 70
  • 121

1 Answers1

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

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

Amber
  • 507,862
  • 82
  • 626
  • 550
  • 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. – Chris Cleeland May 29 '13 at 20:06
  • @ChrisCleeland `git help config` – Amber Jun 07 '13 at 05:09
  • 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' – Neon Jun 01 '15 at 20:14