Skip to content

Commit ebceba7

Browse files
authored
Update sharing-git-credentials.md: Simplify ssh-add
1 parent fca25ec commit ebceba7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

remote/advancedcontainers/sharing-git-credentials.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ There are some cases when you may be cloning your repository using SSH keys inst
3232
You can add your local SSH keys to the agent if it is running by using the `ssh-add` command. For example, run this from a terminal or PowerShell:
3333

3434
```bash
35-
ssh-add $HOME/.ssh/<your ssh key>
35+
ssh-add
3636
```
3737

38+
It will add the default files (`~/.ssh/id_rsa`, `.ssh/id_dsa`, `~/.ssh/id_ecdsa`, `~/.ssh/id_ed25519`, and `~/.ssh/identity`). If you'd like to specify a key, simply append the path to it after the command.
39+
3840
On Windows and Linux, you may get an error because the agent is not running (macOS typically has it running by default). Follow these steps to resolve the problem:
3941

4042
**Windows**:
@@ -67,9 +69,10 @@ if [ -z "$SSH_AUTH_SOCK" ]; then
6769
ssh-agent -s &> $HOME/.ssh/ssh-agent
6870
fi
6971
eval `cat $HOME/.ssh/ssh-agent` > /dev/null
70-
ssh-add $HOME/.ssh/<your ssh key> 2> /dev/null
72+
ssh-add 2> /dev/null
7173
fi
7274
```
75+
7376
On the last line, replace `<your ssh key>` with your specific ssh key.
7477

7578
For example `ssh-add $HOME/.ssh/id_ed25519 2> /dev/null`

0 commit comments

Comments
 (0)