Reputation: 1698
I am looking at my git diff and the lines are exactly reversed. New lines show with "-"s and red colors, and the removed lines show with "+"s and green colors.
+ deleted line [green]
- newline [red]
Nothing in my .gitconfig seems to indicate anything amiss.
Anyone ever seen this happen before? What did you do to fix? Thanks!
Upvotes: 4
Views: 2491
Reputation: 509
In git diff A B
, A is the one in red and B is the one in green (as Eugene said, the order matters)
Upvotes: 6
Reputation: 8200
The direction of the diff is important:
git diff A B
will provide different output than git diff B A
and the difference will be in reversing what was deleted and what was added.
Upvotes: 7
Reputation: 42094
You can instruct the inner diff
to consider its inputs reversed using the -R
option:
git diff -R
But this is a kludge. You'd better clarify what exactly you're diffing and instruct git
to compare things in the order you actually expect.
Upvotes: 0