This directory contains Git configuration files and utilities for managing multiple Git identities with 1Password SSH agent integration.
The Git configuration in these dotfiles provides:
- SSH-based commit signing via 1Password
- Multiple identity management with easy switching
- Secure storage of identity configuration in iCloud
gitconfig.symlink: Main Git configuration file (symlinked to~/.gitconfig)gitignore.symlink: Global Git ignore file (symlinked to~/.gitignore)identity.zsh: Contains functions for managing Git identitiesinstall.sh: Sets up the Git identity system during installation
During installation, ~/.gitidentities is symlinked from iCloud:
ln -sfv "${ICLOUD_CONFIG}/git_identities" ~/.gitidentitiesThis keeps your identity configurations in sync across devices while keeping them separate from your public dotfiles.
The ~/.gitidentities file should contain identity configurations in this format:
[identity "work"]
name = Your Work Name
email = your.email@work.com
signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJi+0V3m...
[identity "personal"]
name = Your Personal Name
email = your.email@personal.com
signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBl7w9A5f...Each identity section includes:
name: Your display name for commitsemail: Your email for commitssigningkey: The SSH public key for signing (managed in 1Password)
The identity.zsh file provides two functions:
-
git-identities: Lists available identities from your configuration
$ git-identities personal work
-
git-assume: Switches to a specific identity
$ git-assume work
When you run git-assume <identity>, it:
- Reads the identity configuration from
~/.gitidentities - Sets
user.nameanduser.emailfor the current repository - Configures the SSH signing key from 1Password
- Enables commit signing automatically
This allows for seamless switching between different GitHub/Git accounts while maintaining proper commit attribution and signing.
Git commit signing is configured to use 1Password's SSH signing capabilities:
[gpg]
format = ssh
[gpg "ssh"]
program = /Applications/1Password.app/Contents/MacOS/op-ssh-signThis setup:
- Uses SSH keys stored in 1Password for commit signing
- Keeps your keys secure (never exposed to the filesystem)
- Prompts for authentication with 1Password when signing