5

I'm using nbstripout to remove Jupyter output before committing. nbstripout generated a .gitattribute file that looks like this:

*.ipynb filter=nbstripout

*.ipynb diff=ipynb

This works as expected, whenever I git status, git diff, or git commit, it doesn't include Jupyter outputs. However, when I remove the second line, it does the same thing.

What does *.ipynb diff=ipynb do in this case?

Leo Jiang
  • 24,497
  • 49
  • 154
  • 284

1 Answers1

3

The diff attribute, when set to a string, references a diff driver.

But the first attributes reference a content filter driver using the same command.
Since the content filter driver is involved when doing a git diff (through the smudge command), it does the same operation (meaning it changes the content of the working tree file compared with the index)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250