0

I am trying to capture the differences across file changes by using

git diff --exit-code --minimal <file>

the problem is that this generates too much output. Let's say I just add a new line on the beginning of the file, the rest remains the same (just in a new line)

the git diff command will output (+) for all lines (new one + all existing ) and also (-) for all existing lines.

I do understand that the whole file changed (all existing lines move 1 line down), but must be a smarter way that can see ignore these "differences" just like kdiff3 can do.

So the only difference that I am interested is the new line that I added (or potentially also a code change in the existing lines).

Any idea how this can be archived?

Alg_D
  • 2,242
  • 6
  • 31
  • 63
  • 1
    Try it with -b, I suspect crlf troubles or some such. I've never seen any diff get one added line wrong like that. – jthill Feb 26 '15 at 00:12
  • That rocks, super simple! Many thanks. – Alg_D Feb 26 '15 at 00:15
  • @Algina: It would be good if you set your autocrlf policy so that you do not encounter this problem while collaborating! This might help you: http://stackoverflow.com/questions/1967370/git-replacing-lf-with-crlf/20653073#20653073 – Mudassir Razvi Feb 26 '15 at 06:27

0 Answers0