2014/12/07

一台电脑使用多个github账号[How to use more github accounts in one PC]

工作一个号,私人一个号。
If U have two or more github accounts just like me, then you can need this artical.

Step 1:

创建一个新的RSA秘钥。
Generate a new SSH key

 注意要将名字改一下。
When you're prompted to "Enter a file in which to save the key",DO NOT press Enter to continue. Enter some words like work/personal/work_rsa...

 

Step 2:

编辑一下ssh的连接配置。基本上按照我的这个就可以。
Editor the ssh's config.Type these words just like what  I do. Or change the "github_work" to what you like.You will use it later.
$ vi ~/.ssh/config

Step 3:

https://help.github.com/articles/generating-ssh-keys/#step-3-add-your-ssh-key-to-your-account

Step 4:

测试一下成功了没。如果出现了这个情况,那就是代表成功了。
Test everything out.

 

Step 5:

初始化git的时候要注意,
git clone git@github.com:[yourname]/[yourproject.git]
要换成
git clone git@github_work:[yourname]/[yourproject.git]

When you want to use your work account, please remember to change the hostname.
NOT github.com but github_work[the name that you typed the first time]


Step 6:

 接下来的步骤就跟平时一样了,如果你没出错的话~
Enjoy it.  Do what you usually do.

没有评论:

发表评论