Homebrew M1 Migration

As part of my MacBook upgrade, I directly transferred my old laptop’s data into my new one. So when I naively ran brew update I received the following:

/usr/local/Homebrew/Library/Homebrew/cmd/update.sh: line 37: /usr/local/bin/git: Bad CPU type in executable

Rather than try to debug this and countless other libraries not working because they were intended for Intel instead of ARM, I used the opportunity to uninstall Homebrew and start fresh. After reinstalling Homebrew and adding the recommended commands to my .zprofile to add Homebrew to my PATH, I was in good shape.

Hello Vim, my old friend

When checking my .zprofile for errors, I noticed Vim was yelling at me. That reminded me of my dotfiles repo, so I ran to its README to run the installation instructions. And they worked! So while Vim these days is used more for the occasional commit message edit and not my entire workflow, I’m still very grateful for having a good jumping off point for a fresh install. It also reminds me I should add things like fnm and gh if I want them to be part of my toolchain by default.

Speaking of Git

As soon as I finished that thought I ran into this error trying to commit:

error: gpg failed to sign the data
fatal: failed to write commit object

Great! So now I need to figure out how to get my signing working again.

1Password CLI and SSH Signing

1Password has a CLI that can be downloaded directly or installed via brew install 1password-cli. I just had to check a few boxes and told 1Password to configure my ~/.ssh/config correctly.

1Password Developer configuration screen

After I imported my old key to 1Password it prompted me to set-up commit signing with SSH — I didn’t know that was a thing! So after adding my SSH key as a signing key (instead of as an auth key — it was already added as such), I was able to see the fruits of my labor:

My latest dotfiles repo commit, in all its verified goodness

Because the new MacBook has a fingerprint reader, I can easily add that as an additional check whenever I need to sign my commits. Maybe not the most necessary given what I do day-to-day, but I think it’s neat and glad it was so easy to use.