Skip to content

Instantly share code, notes, and snippets.

@shuiRong
Created January 22, 2018 06:11
Show Gist options
  • Save shuiRong/2363ff26775da5247a7d79c3f6b72656 to your computer and use it in GitHub Desktop.
Save shuiRong/2363ff26775da5247a7d79c3f6b72656 to your computer and use it in GitHub Desktop.
github ssh 多账号配置
创建新的SSH key
ssh-keygen -t rsa -C "your-email-address"
config文件的内容如下:
#Default GitHub
Host github.com
HostName github.com
User one
IdentityFile ~/.ssh/id_rsa
Host github-second
HostName github.com
User javashop
IdentityFile ~/.ssh/id_rsa_second
如何使用
```
git remote rm origin
git remote add origin git@javashop.github.com:javashop/HiZoom.git
git@[config.hostname]:[config.username]/[github项目地址]
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment