0

I'd like

git diff

to only display the differences, nothing "near" my changes.

How can I do this?

Brad Parks
  • 66,836
  • 64
  • 257
  • 336

1 Answers1

1

Turns out the git docs don't use the word "near". They use "context" instead, so

git diff -U0

means display 0 lines of context around your diffs, as described in the git-diff man page:

-U, --unified= Generate diffs with lines of context instead of the usual three. Implies

Brad Parks
  • 66,836
  • 64
  • 257
  • 336
  • Did you ask a question then answer it yourself 2 seconds later? – houtanb Nov 16 '15 at 15:33
  • 1
    It's actually encouraged by SO to post and answer your own question if it is not already on SO and you found the answer. There is even a checkbox to directly add an answer when posting a question. See [its ok to ask and answer your own questions](http://blog.stackoverflow.com/2011/07/its-ok-to-ask-and-answer-your-own-questions/) – dfherr Nov 16 '15 at 16:47
  • Yeah the reason I put the question here is because when I google around for it, I didn't find an answer. It was clearly there in the docs once I read them carefully. I was just searching for the word "near", but should've been looking for "context" when googling. – Brad Parks Nov 16 '15 at 18:16