git configure multiple warehouse

git configure multiple warehouse

github , gitee , coding , gitlab , gitlab.company .....

Really TM and more.

Generate ssh

Generate ssh key pair. The company according to their own rules generate, or press the corresponding guide generation platform.

Paste Gitee guidance here.

Code Clouds Help Center - Generate / Add SSH Public Key

Different platforms, the generated key to configure different name.

Upload the public key to the platform

Paste Gitee guidance here.

Help -SSH public cloud code set

Configuring ssh

config

Found in the user directory ~/.ssh/config, if configdoes not exist, you can create your own, without the suffix.

In configadd the following content:

# gitee
Host gitee.com
 HostName gitee.com
 PreferredAuthentications publickey
 IdentityFile ~/.ssh/gitee_id_rsa
# github
Host github.com
 HostName github.com
 PreferredAuthentications publickey
 IdentityFile ~/.ssh/github_id_rsa
# gitlab
Host gitlab
 HostName gitlab.com
 PreferredAuthentications publickey
 IdentityFile ~/.ssh/gitlab_id_rsa

Different platforms, using a different key.

Not bin it.

Add to ssh-agent

$ ssh-add ~/.ssh/github_id_rsa
$ ssh-add ~/.ssh/gitee_id_rsa
$ ssh-add ~/.ssh/gitlab_id_rsa

By ssh-add -lhas been added to the agent in the key view.

You can play up

$ ssh -T [email protected]
$ ssh -T [email protected]

OVER!

Guess you like

Origin www.cnblogs.com/ElEGenT/p/11769350.html