code-snippets/docs/git/ssh-config.md

14 lines
421 B
Markdown
Raw Normal View History

2024-09-05 13:54:08 +10:00
# Git SSH Config
When using SSH to connect to a remote repository, you can configure your SSH client to use a specific key for a specific host. This is useful when you have multiple keys and want to use a specific key for a specific host.
Sample configuration is below
```bash
# ~/.ssh/config
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/my-github-key
PreferredAuthentications publickey
```