Guides

New Mac setup for developers: everything git doesn't bring back

Your code is on GitHub. Your apps reinstall from Homebrew. What actually gets lost when you wipe a Mac is the small stuff that was never committed: .env files, SSH keys, signing certificates and tokens. Here's what to collect before you erase the old Mac, and how to move each of them.

Updated October 31, 2026

Migration Assistant or a clean install?

Migration Assistant copies everything, including years of leftover caches, old runtimes and launch agents you've forgotten about. Many developers prefer a clean install and bring things over on purpose. That's the approach this checklist assumes. If you do use Migration Assistant, still go through the list: it's the fastest way to find out what you depend on that isn't backed up anywhere else.

1. Secrets inside your projects

Cloning your repos takes minutes. Most of them won't run afterwards, because what's gitignored doesn't come back with them: .env, .env.local, .dev.vars (Cloudflare Workers), .envrc, *.tfvars, Firebase service-account.json files, GoogleService-Info.plist, Android keystores and key.properties.

Find them all with one command (adjust ~/Code to wherever your projects live):

find ~/Code \( -name node_modules -o -name .git -o -name vendor \) -prune -o \
  -type f \( -name '.env*' -o -name '*.env' -o -name '.dev.vars*' -o -name '.envrc' \
  -o -name '*.tfvars' -o -name '*.pem' -o -name '*.key' -o -name '*.p8' -o -name '*.p12' \
  -o -name '*.jks' -o -name '*.keystore' -o -name '*service-account*.json' \) -print

Skip .env.example and other templates, since those are committed. For everything else, note which repo and which path it belongs to. Copying the files to a USB stick works but isn't safe: they're plain text. See how to back up .env files for better options.

2. SSH and GPG keys

Copy ~/.ssh (you can leave out known_hosts) to the new Mac and fix the permissions, or SSH will refuse the key:

chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_ed25519 ~/.ssh/config
ssh-add --apple-use-keychain ~/.ssh/id_ed25519

If you sign commits with GPG, export the secret key on the old Mac and import it on the new one:

gpg --export-secret-keys --armor you@example.com > private.asc   # old Mac
gpg --import private.asc                                          # new Mac, then delete private.asc

Alternatively, create new keys on the new Mac and add them to GitHub. That's cleaner, but every server that trusts the old key needs the new one.

3. Apple signing certificates and App Store Connect keys

If you ship Mac or iOS apps, this is the most painful thing to lose:

  • Developer ID certificates: the private key exists only in your login keychain. In Keychain Access, find “Developer ID Application: …” under My Certificates, expand it to check the private key is there, and choose File › Export Items to save a password-protected .p12. Double-click it on the new Mac. Without it, you have to revoke the certificate and create a new one.
  • App Store Connect API keys (AuthKey_XXXX.p8): Apple lets you download each one once. notarytool and fastlane usually look for them in ~/.appstoreconnect/private_keys. Copy that folder.
  • Provisioning profiles download again from Xcode, so you don't need to back them up.

4. Cloud and registry credentials in your home folder

These are dotfiles that hold long-lived tokens:

  • ~/.aws/credentials and ~/.aws/config
  • ~/.kube/config
  • ~/.config/gcloud (application default credentials)
  • ~/.npmrc, ~/.pypirc, ~/.netrc, ~/.cargo/credentials.toml, ~/.gem/credentials
  • ~/.gradle/gradle.properties and ~/.m2/settings.xml
  • age and SOPS keys (~/.config/sops/age/keys.txt). Lose these and your encrypted secrets stay encrypted for good.
  • Tokens hardcoded in ~/.zshrc (export OPENAI_API_KEY=…)

You can skip CLIs that log in through the browser (gh auth login, Wrangler, Vercel, Fly, Firebase). Logging in again takes seconds, and a copied refresh token is one more thing that can leak.

5. Apps, tools and dotfiles

This is the easy part. On the old Mac, run brew bundle dump --file ~/Brewfile, then brew bundle --file ~/Brewfile on the new one. Keep your dotfiles (.zshrc, .gitconfig, editor settings) in a git repo, without the tokens from step 4. Language versions come back from .tool-versions or .nvmrc files in your repos.

6. Before you erase the old Mac

  1. Clone two or three real projects on the new Mac and run them. Missing secrets show up as errors right away.
  2. Push to GitHub over SSH and sign a commit.
  3. For Apple developers: run a notarization (xcrun notarytool history is enough to check the key).
  4. Only then erase the old Mac.

Doing all of this automatically

We built Vault because we kept doing this by hand. It finds every file above, in your projects and your home folder, encrypts them on your Mac, and keeps them in your own iCloud, with a backup every day. On a new Mac, you paste your master key, Vault clones your repos from their git remotes and puts each secret back where it was, with the right permissions. It also exports your Developer ID certificate, which is the one thing you can't download again.

Make your next new Mac boring.

Free for 3 projects, plus your home folder and Apple developer keys. macOS 14 or later.

Download Vault