Skip to content

Git: Access & secrets

Git commands for access & secrets (tags: #access #secrets #ssh).

Index
1 items

Git: Use a specific SSH key for one repo

Safe

Per-repo SSH key, handy for multiple GitHub accounts.

git config core.sshCommand "ssh -i <key-file> -o IdentitiesOnly=yes"
What each part does
  1. git configset a repo-local setting (stored in .git/config)
  2. core.sshCommandthe ssh command git uses for this repo
  3. ssh -i <key-file>use this private key
  4. -o IdentitiesOnly=yesdon't also offer agent keys (avoids authenticating as the wrong account)

Also known as: multiple github accounts · permission denied (publickey)

My DevOps Playbook by Angelo John Calleja

New runbook

GitHub not connected

Saving is handled by the site: the GitHub token is stored in Cloudflare, not in your browser. Enter the editor password (the EDITOR_PASSWORD secret) to unlock saving in this browser.

Saving commits to gelogrammer/My_DevOps_Playbook. Create a fine-grained token with access to only this repo andContents: Read and write, then paste it here. It is stored only in this browser.

src/content/docs/…