- For HTTPS authentication, use the GitHub CLI;
gh auth login
. - When HTTPS is desired, use
git clone --recursive https://github.com/user/repo.git
.
Note
Please note that the GitHub CLI must be installed via brew
. See the how the helper is invoked in gitconfig.
# Fix directory permissions
chmod 700 ~/.ssh
# Fix all key permissions
chmod 600 ~/.ssh/*
chmod 644 ~/.ssh/*.pub
# Fix special files permissions
chmod 644 ~/.ssh/authorized_keys
chmod 644 ~/.ssh/known_hosts
chmod 644 ~/.ssh/config
- Add the machine's
id_rsa.pub
orid_ed25519.pub
SSH key to GitHub. - Hook up 1Password with the ssh agent, see
~/.config/1Password/ssh/agent.toml
. - When SSH is desired, use
git clone --recursive [email protected]:user/repo.git
.
Find the item in 1Password containing the git commit signing key info and save this as ~/.gitconfig_1password
. This file is included by ~/.gitconfig
of these dotfiles. On WSL, replace the path to the CLI with /mnt/c/ ...
in ~/.gitconfig_1password
.
Also, edit ~/.config/1Password/ssh/agent.toml
to say something like:
[[ssh-keys]]
vault = "Workplace"
[[ssh-keys]]
vault = "Personal"
Review/update the email used in ~/.gitconfig_work
.