Reputation: 2585
When I use git diff
, I saw the differences like below:
- self.conv_2 = nn.Conv2d(C_in, C_out // 2, 1, stride=2, padding=0, bias=False)
+ self.conv_2 = nn.Conv2d(C_in, C_out // 2, 1, stride=2, padding=0, bias=False)
And I'm sure there are no white backspace difference in these two lines. However, I think these two lines are totally same.
I wonder why does git think they are different?
And is there a way to let git diff
show the special characters difference?
Upvotes: 14
Views: 5945
Reputation: 6877
The --ws-error-highlight
flag might be useful.
git diff --ws-error-highlight=all
Alternatively, you can pipe the git diff
output to cat
and use its -A
flag to explicitly print a variety of non-printing characters.
git diff | cat -A
Upvotes: 31