{"id":10655,"date":"2022-07-09T13:32:55","date_gmt":"2022-07-09T17:32:55","guid":{"rendered":"https:\/\/irreal.org\/blog\/?p=10655"},"modified":"2022-07-10T13:10:40","modified_gmt":"2022-07-10T17:10:40","slug":"git-delta-with-magit","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=10655","title":{"rendered":"Git Delta with Magit"},"content":{"rendered":"<p>I rarely use any of the diff utilities these days and when I do it\u2019s mostly Ediff to resolve merge conflicts. That probably means I\u2019m working too hard but I\u2019ve always been that way: I just never think of using diff unless I\u2019m really in trouble.<\/p>\n<p>Most other folks are more reasonable and use some sort of diff regularly. A common use case is checking the differences between two versions of a file stored in a Git repository. Magit, of course, has that built in\u2014several options, in fact\u2014but Kaushal Modi really likes the syntax highlighted diff he gets with the command line tool <a href=\"https:\/\/github.com\/dandavison\/delta\">delta<\/a>.<\/p>\n<p>Of course, Modi wants to stay in Emacs and use Magit. Fortunately, Dan Davison, the author of delta has a package, <a href=\"https:\/\/github.com\/dandavison\/magit-delta\">magit-delta<\/a>, that allows it to work with Magit. Installation is pretty easy. Just install delta from your favorite package manager (it\u2019s called <code>git-delta<\/code> in most package managers) and then install magit-delta by adding it to your <code>init.el<\/code>.<\/p>\n<p>There is, apparently, an issue with displaying line numbers with git-delta (an issue has been raised) but it\u2019s easy to work around that. Take a look at <a href=\"https:\/\/scripter.co\/using-git-delta-with-magit\/?utm_source=atom_feed\">Modi\u2019s post<\/a> to see screen shots of both the normal delta and the magit-delta output. If you like what you see, just install delta and magit-delta and give them a try. It\u2019s easy to turn it off if you decide you don\u2019t like it.<\/p>\n<p><b>UPDATE<\/b> <span class=\"timestamp-wrapper\"><span class=\"timestamp\">[2022-07-10 Sun 13:09]<\/span><\/span>: Added link to Modi\u2019s post.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I rarely use any of the diff utilities these days and when I do it\u2019s mostly Ediff to resolve merge conflicts. That probably means I\u2019m working too hard but I\u2019ve always been that way: I just never think of using &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=10655\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[18],"class_list":["post-10655","post","type-post","status-publish","format-standard","hentry","category-general","tag-emacs"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10655"}],"version-history":[{"count":2,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10655\/revisions"}],"predecessor-version":[{"id":10659,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10655\/revisions\/10659"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}