Savvas Parastatidis
Savvas Parastatidis

Reputation: 802

Git diff to see lines that have NOT been modified?

I basically want the opposite of git diff. I want a way to see the lines that have not been modified/removed etc. Is this possible through the CLI?

Upvotes: 0

Views: 319

Answers (2)

tripleee
tripleee

Reputation: 189387

You can pass a ridiculously large value for -U and then filter out the lines which contain differences.

git diff -U20000 | grep -v '^[-+]'

This still fails to show files which don't contain any differences, though. You could diff against the original check-in to force all files to have changes, but that's not always what you want, either.

Upvotes: 2

Alex Vermeulen
Alex Vermeulen

Reputation: 51

i believe tools like tortoise-diff show all lines, if you want to see unchanged ones then just ignore the highlighted ones. in what case are unchanged lines interesting anyway?

Upvotes: 0

Related Questions