Magit sometimes becomes very slow, when it thinks that certain large files should be diffed. Examples for this are SVG graphics or SQL dumps (technically seen as text files). The files are small enough that they should be controlled by git, but seemingly too large (and with very long lines) for magit to display.

Is there a way to tell magit not to create the diff for certain file types? Maybe something like a blacklist?

  • Binary for Magit only? You still need other git front-ends to provide diffs?
    – phils
    Commented Jul 7, 2020 at 19:37
  • Good point, it will mostly be the same wanted behavior for all front-ends. Still being able to switch it on/off for a specific magit diff invocation would be nice.
    – quazgar
    Commented Jul 8, 2020 at 6:51

1 Answer 1


This can be done for a whole repository with a .gitattributes file (or globally with $XDG_CONFIG_HOME/git/attributes):

# content of .gitattributes

*.svg   -diff
*.sql   -diff

Kudos to @phils for the comment which led me to write this answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.