Using Git difftool

Recently I needed to recover some changes in a KiCad PCB file. I had deleted several components to debug a STEP export problem which ended up being a board outline issue. After I fixed the board outline (an imported DXF file had crazy numbers like 50.23812592), I realized I needed to add the deleted components back in. vim difftool came in handy:

git difftool -t nvimdiff

Fortunately, the KiCad file format is very easy to read and diff so I was able to easily recover the changes by navigating to the change I wanted, and typing diffpu to put the change into the other window.

You can default to using vimdiff by running something like:

git config --global diff.tool vimdiff
git config --global difftool.prompt false
git config --global alias.d difftool

(in case it is not obvious yet, many of the posts on this site are notes about things I want to remember how to do in the future – feel free to do the same …)