1+ MULTIPLE PUBLIC SSH KEY ON YOUR MAC OSX
2+ =======================================
3+
141. CREATE YOUR SSH KEYS
5+ -----------------------
26First you need to create your two ssh key
37
48 >> ssh-keygen -t rsa -C "test1@test.com"
59 >> ssh-keygen -t rsa -f ~/.ssh/id_rsa_OTHER_LABEL -C "test2@test.com"
610
7- <b> Note:</b> You can use anyname for your public second key
8-
11+ Note: You can use anyname for your public second key
12+ ----
913
10142. ATTACH THE GITHUB KEYS
15+ -------------------------
1116
1217login in each github account and attach your keys respectively.
1318What do you gonna attach ?
@@ -16,12 +21,13 @@ What do you gonna attach ?
1621copy and paste into the public key field at github page
1722
18233. CREATE A CONFIG FILE
24+ -----------------------
1925Well, we create two differents ssh keys and attach respectively in github.
2026Now, we have to create a way to identify the differents github accounts.
2127
2228 Create a config file
23- >> touch ~/.ssh/config
24- >> vim ~/.ssh/config
29+ $ touch ~/.ssh/config
30+ $ vim ~/.ssh/config
2531
2632example:
2733
@@ -39,17 +45,18 @@ Host github-company
3945and save the changes.
4046
41474. HOW IT WORKS?
48+ ----------------
4249
4350Now, if you wanna create new project, you have to specify the HOST name in the
4451add remote origin step change.
4552
4653Example
47- git init
48- git commit -m"firt commit"
54+ $ git init
55+ $ git commit -m"firt commit"
4956#now if you use your first one ( normal github )
50- git remote add origin git@github.com:Company/testing.git
57+ $ git remote add origin git@github.com:Company/testing.git
5158#instead it you want to use the other user just change the HOST name
52- git remote add origin git@github-COMPANY:Company/testing.git
59+ $ git remote add origin git@github-COMPANY:Company/testing.git
5360
5461:)
5562
0 commit comments