tadpole
tadpole

Reputation: 1219

can i add multiple ssh keys to github?

I currently have a account on a Linux machine that I use to access the code repository. The ssh key was updated a long while back. It has been working just fine. I am no expert in GIT. I followed someone instructions to set up the Linux box. It has been awhile so I can't remember all the steps. Now, I have a new Windows machine. I would like to access my code from this Windows machine too. I have the ssh key for the Windows machine, I would like to add that to GIT. I still need to access the repository from the Linux box so I don't want to mess up the current setting.

If I add the new ssh key to GITLAB, would it append the new key to the previous key or would it override the previous key ?

Upvotes: 0

Views: 210

Answers (1)

Code-Apprentice
Code-Apprentice

Reputation: 83527

Yes, you can add multiple SSH keys to a single GitHub account. GitLab has documentation showing how to set up SSH keys. Just follow those steps on each machine that you use.

I have the ssh key for the Windows machine, I would like to add that to GIT.

Note that you don't add an SSH key to Git. In fact, Git itself knows nothing about SSH. Instead, you upload your public SSH key to an online service, like GitHub or GitLab. Then you use SSH with commands like git clone and git push. The only reason Git knows to use SSH is because it is specified in the URL.

If I add the new ssh key to GITLAB, would it append the new key to the previous key or would it override the previous key ?

You don't append keys. Typically most online accounts let you add multiple keys to use for login. Adding a new key shouldn't override any existing keys.

Upvotes: 1

Related Questions