CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Sat, 19 Jul 2025 10:52:38 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20081223144416
location: https://web.archive.org/web/20081223144416/https://github.com/guides/multiple-github-accounts.atom
server-timing: captures_list;dur=0.653179, exclusion.robots;dur=0.021845, exclusion.robots.policy;dur=0.010461, esindex;dur=0.011355, cdx.remote;dur=172.775678, LoadShardBlock;dur=501.687596, PetaboxLoader3.datanode;dur=148.046236, PetaboxLoader3.resolve;dur=186.713409
x-app-server: wwwb-app203
x-ts: 302
x-tr: 731
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: SERVER=wwwb-app203; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Sat, 19 Jul 2025 10:52:39 GMT
content-type: application/atom+xml; charset=utf-8
content-length: 73727
x-archive-orig-server: nginx/0.6.26
x-archive-orig-date: Tue, 23 Dec 2008 14:44:16 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-x-runtime: 662ms
x-archive-orig-etag: "2d77d19cb27402eac398a823fb74e93e"
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-orig-content-length: 73727
cache-control: max-age=1800
x-archive-guessed-content-type: text/xml
x-archive-guessed-charset: utf-8
memento-datetime: Tue, 23 Dec 2008 14:44:16 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Tue, 23 Dec 2008 14:44:16 GMT", ; rel="memento"; datetime="Tue, 23 Dec 2008 14:44:16 GMT", ; rel="last memento"; datetime="Tue, 23 Dec 2008 14:44:16 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_7_20081223135951_crawl107-c/52_7_20081223144235_crawl103.arc.gz
server-timing: captures_list;dur=0.534987, exclusion.robots;dur=0.019038, exclusion.robots.policy;dur=0.008751, esindex;dur=0.011407, cdx.remote;dur=11.716507, LoadShardBlock;dur=234.855572, PetaboxLoader3.datanode;dur=109.586995, PetaboxLoader3.resolve;dur=147.228274, load_resource;dur=102.723213
x-app-server: wwwb-app203
x-ts: 200
x-tr: 389
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
accept-ranges: bytes
tag:github.com,2008:/guides/multiple-github-accounts
GitHub Guides - Multiple GitHub Accounts
2008-11-19T07:56:28-08:00
tag:github.com,2008:Guide/42
2008-04-24T16:24:28-07:00
2008-11-19T07:56:28-08:00
Multiple GitHub Accounts - version 11
Wed Nov 19 07:56:28 -0800 2008
<p style="background:#fefeb4;border:1px solid #dddddd;font-weight:bold;;">The solution detailed in this guide is fairly complex and may not be ideal for most users.<br />
We recommend you check out the solutions detailed in <a href="https://github.com/guides/managing-multiple-clients-and-their-repositories">Managing multiple clients and their repositories</a> first.</p>
<h2>The Problem</h2>
<p>One might encounter a situation where two GitHub accounts might be necessary. Naturally, I mean two <strong>pay</strong> accounts in order to remain in good standing according to the <span class="caps">TOS</span> (or one free and one pay account). And we all want to stay in good standing with GitHub since they were awesome enough to make this great web application, right? Nevertheless, with that said, one might find one’s self in this situation.</p>
<p>A problem that one is likely to encounter in this situation is attempting to maintain two or more repositories that use more than one GitHub account. Using the default public/private key setup that GitHub suggests works great when only one account is involved, but when one attempts to clone a repository using a second account, by default, git attempts to use the first account, which is likely declined resulting in failure.</p>
<p>This article is assuming that you already have two git accounts created and that you already have the first <a href="https://github.com/guides/providing-your-ssh-key">key pair</a> in place on both your local system and on GitHub.</p>
<h2>Generating a Second Key Pair</h2>
<p>Read this section <span class="caps">COMPLETELY</span> before actually doing anything. You could easily get yourself into a lot of trouble if you do not. GitHub identifies which account you are attempting to access by the <span class="caps">SSH</span> key that you give it. To this end, you cannot use the same key pair for more than one GitHub account. You will need to follow the instructions given in the guide entitled <a href="https://github.com/guides/providing-your-ssh-key">Providing your <span class="caps">SSH</span> Key</a>. I think it would be unwise to reproduce part of that guide here.</p>
<p>Upon executing the ssh-keygen command, you will be presented with a prompt similar to the following:</p>
<pre>
<code>Enter file in which to save the key (/Users/tom/.ssh/id_rsa):</code>
</pre>
<p><b><span class="caps">WARNING</span></b>: If you already had a key pair and are using it for anything at all, do <span class="caps">NOT</span> leave this blank nor should you use the default file suggested. It will overwrite your primary key pair, and that would be very bad.</p>
<p>Instead of using “id_rsa”, you should use something like “id_rsa_github_useraccount” to denote the purpose of the key. So ultimately, you would enter:</p>
<pre>
<code>/Users/tom/.ssh/id_rsa_github_useraccount</code>
</pre>
<h2>Placing the Public and Private Keys</h2>
<h3>Private Key</h3>
<p>You will not actually be putting the private key anywhere, but instead only referencing it. For this, you will need to open the <span class="caps">SSH</span> config (~/.ssh/config) file in your favorite editor. Once in this file, you should add the following:</p>
<pre>
<code>
# GitHub for cylence
Host github-tom
HostName github.com
User git
IdentityFile /Users/tom/.ssh/id_rsa_git_tom
</code>
</pre>
<p>The top line is a simple comment, you can leave this out of you choose. Next is the name of the Host, this is what you will use when referencing this connection and after the word “Host” followed by a space is completely arbitrary. The HostName must be “github.com” as is the same with the User.Notice that it is still “git” and not an account name. Lastly, the IdentityFile line must contain a non-reative path to your newly created private key (NOT ending with .pub).</p>
<h3>Public Key</h3>
<p>Once the private key is properly being referenced, you must tell GitHub what the public key is. You do this by accessing your <a href="https://github.com/account">account page</a> on GitHub. Place your public key (including the carriage return at the end) into the “SSH Public Keys” textarea field.</p>
<h2>Using the Newly Created Keys</h2>
<p>From here on, everything is the same except for one component. To present an example, we will look at a standard clone command.</p>
<pre>
<code>
git clone git@github.com:account/repository.git
</code>
</pre>
<p>Traditionally, this command consists of “git clone”, the command to be performed, followed by a mostly ordinary ssh connection.</p>
<pre>
<code>
user@domain:path/somewhere/file.extension
</code>
</pre>
<p>What we will be changing is the domain portion of this line. Instead of using the domain “github.com”, we will be specifying the pre-configured <span class="caps">SSH</span> connection we built earlier. It is referenced using the Host line. Using our previous example, the end result would look like this:</p>
<pre>
<code>
git clone git@github-tom:account/repository.git
</code>
</pre>
<p>Thanks to <a href="https://github.com/mojombo">mojombo</a> for originally assisting me with this issue.</p>
<h2> Note: if you are running keychain to manage your <span class="caps">SSH</span> keys you may need to stop ssh-agent and add the new key to your keyring for it to work properly. If you are seeing failed access to your repositories as your other user, even though you’re configured to use the new key with your correct user you may wish to give this a try. On <span class="caps">OSX</span> Leopard is built in keychain integration, so either don’t store your passphrase in keychain or don’t use passphrase for your private key at all.</h2>
<h2>Note2: Regarding multiple local keys and ssh-agent, you can also try prefixing your git commands (when interacting with the remote repo) with <span class="caps">SSH</span>_AUTH_SOCK=””, which will make ssh not use the ssh-agent.</h2>
torarnv
torarnv@gmail.com
tag:github.com,2008:Guide/42
2008-04-24T16:24:28-07:00
2008-11-19T07:55:42-08:00
Multiple GitHub Accounts - version 10
Wed Nov 19 07:55:42 -0800 2008
<p style="background:#fefeb4;border:1px solid #dddddd;font-weight:bold;;">The solution detailed in this guide is fairly complex and may not be ideal for most users.<br />
We recommend you check out the solutions detailed in <a href="https://github.com/guides/managing-multiple-clients-and-their-repositories">Managing multiple clients and their repositories</a> first.</p>
<h2>The Problem</h2>
<p>One might encounter a situation where two GitHub accounts might be necessary. Naturally, I mean two <strong>pay</strong> accounts in order to remain in good standing according to the <span class="caps">TOS</span> (or one free and one pay account). And we all want to stay in good standing with GitHub since they were awesome enough to make this great web application, right? Nevertheless, with that said, one might find one’s self in this situation.</p>
<p>A problem that one is likely to encounter in this situation is attempting to maintain two or more repositories that use more than one GitHub account. Using the default public/private key setup that GitHub suggests works great when only one account is involved, but when one attempts to clone a repository using a second account, by default, git attempts to use the first account, which is likely declined resulting in failure.</p>
<p>This article is assuming that you already have two git accounts created and that you already have the first <a href="https://github.com/guides/providing-your-ssh-key">key pair</a> in place on both your local system and on GitHub.</p>
<h2>Generating a Second Key Pair</h2>
<p>Read this section <span class="caps">COMPLETELY</span> before actually doing anything. You could easily get yourself into a lot of trouble if you do not. GitHub identifies which account you are attempting to access by the <span class="caps">SSH</span> key that you give it. To this end, you cannot use the same key pair for more than one GitHub account. You will need to follow the instructions given in the guide entitled <a href="https://github.com/guides/providing-your-ssh-key">Providing your <span class="caps">SSH</span> Key</a>. I think it would be unwise to reproduce part of that guide here.</p>
<p>Upon executing the ssh-keygen command, you will be presented with a prompt similar to the following:</p>
<pre>
<code>Enter file in which to save the key (/Users/tom/.ssh/id_rsa):</code>
</pre>
<p><b><span class="caps">WARNING</span></b>: If you already had a key pair and are using it for anything at all, do <span class="caps">NOT</span> leave this blank nor should you use the default file suggested. It will overwrite your primary key pair, and that would be very bad.</p>
<p>Instead of using “id_rsa”, you should use something like “id_rsa_github_useraccount” to denote the purpose of the key. So ultimately, you would enter:</p>
<pre>
<code>/Users/tom/.ssh/id_rsa_github_useraccount</code>
</pre>
<h2>Placing the Public and Private Keys</h2>
<h3>Private Key</h3>
<p>You will not actually be putting the private key anywhere, but instead only referencing it. For this, you will need to open the <span class="caps">SSH</span> config (~/.ssh/config) file in your favorite editor. Once in this file, you should add the following:</p>
<pre>
<code>
# GitHub for cylence
Host github-tom
HostName github.com
User git
IdentityFile /Users/tom/.ssh/id_rsa_git_tom
</code>
</pre>
<p>The top line is a simple comment, you can leave this out of you choose. Next is the name of the Host, this is what you will use when referencing this connection and after the word “Host” followed by a space is completely arbitrary. The HostName must be “github.com” as is the same with the User.Notice that it is still “git” and not an account name. Lastly, the IdentityFile line must contain a non-reative path to your newly created private key (NOT ending with .pub).</p>
<h3>Public Key</h3>
<p>Once the private key is properly being referenced, you must tell GitHub what the public key is. You do this by accessing your <a href="https://github.com/account">account page</a> on GitHub. Place your public key (including the carriage return at the end) into the “SSH Public Keys” textarea field.</p>
<h2>Using the Newly Created Keys</h2>
<p>From here on, everything is the same except for one component. To present an example, we will look at a standard clone command.</p>
<pre>
<code>
git clone git@github.com:account/repository.git
</code>
</pre>
<p>Traditionally, this command consists of “git clone”, the command to be performed, followed by a mostly ordinary ssh connection.</p>
<pre>
<code>
user@domain:path/somewhere/file.extension
</code>
</pre>
<p>What we will be changing is the domain portion of this line. Instead of using the domain “github.com”, we will be specifying the pre-configured <span class="caps">SSH</span> connection we built earlier. It is referenced using the Host line. Using our previous example, the end result would look like this:</p>
<pre>
<code>
git clone git@github-tom:account/repository.git
</code>
</pre>
<p>Thanks to <a href="https://github.com/mojombo">mojombo</a> for originally assisting me with this issue.</p>
<h2> Note: if you are running keychain to manage your <span class="caps">SSH</span> keys you may need to stop ssh-agent and add the new key to your keyring for it to work properly. If you are seeing failed access to your repositories as your other user, even though you’re configured to use the new key with your correct user you may wish to give this a try. On <span class="caps">OSX</span> Leopard is built in keychain integration, so either don’t store your passphrase in keychain or don’t use passphrase for your private key at all.</h2>
<h2>Note2: You can also try prefixing your git commands (when interacting with the remote repo) with <span class="caps">SSH</span>_AUTH_SOCK=””, which will make ssh not use the ssh-agent.</h2>
torarnv
torarnv@gmail.com
tag:github.com,2008:Guide/42
2008-04-24T16:24:28-07:00
2008-08-22T00:14:06-07:00
Multiple GitHub Accounts - version 9
Fri Aug 22 00:14:06 -0700 2008
<p style="background:#fefeb4;border:1px solid #dddddd;font-weight:bold;;">The solution detailed in this guide is fairly complex and may not be ideal for most users.<br />
We recommend you check out the solutions detailed in <a href="https://github.com/guides/managing-multiple-clients-and-their-repositories">Managing multiple clients and their repositories</a> first.</p>
<h2>The Problem</h2>
<p>One might encounter a situation where two GitHub accounts might be necessary. Naturally, I mean two <strong>pay</strong> accounts in order to remain in good standing according to the <span class="caps">TOS</span> (or one free and one pay account). And we all want to stay in good standing with GitHub since they were awesome enough to make this great web application, right? Nevertheless, with that said, one might find one’s self in this situation.</p>
<p>A problem that one is likely to encounter in this situation is attempting to maintain two or more repositories that use more than one GitHub account. Using the default public/private key setup that GitHub suggests works great when only one account is involved, but when one attempts to clone a repository using a second account, by default, git attempts to use the first account, which is likely declined resulting in failure.</p>
<p>This article is assuming that you already have two git accounts created and that you already have the first <a href="https://github.com/guides/providing-your-ssh-key">key pair</a> in place on both your local system and on GitHub.</p>
<h2>Generating a Second Key Pair</h2>
<p>Read this section <span class="caps">COMPLETELY</span> before actually doing anything. You could easily get yourself into a lot of trouble if you do not. GitHub identifies which account you are attempting to access by the <span class="caps">SSH</span> key that you give it. To this end, you cannot use the same key pair for more than one GitHub account. You will need to follow the instructions given in the guide entitled <a href="https://github.com/guides/providing-your-ssh-key">Providing your <span class="caps">SSH</span> Key</a>. I think it would be unwise to reproduce part of that guide here.</p>
<p>Upon executing the ssh-keygen command, you will be presented with a prompt similar to the following:</p>
<pre>
<code>Enter file in which to save the key (/Users/tom/.ssh/id_rsa):</code>
</pre>
<p><b><span class="caps">WARNING</span></b>: If you already had a key pair and are using it for anything at all, do <span class="caps">NOT</span> leave this blank nor should you use the default file suggested. It will overwrite your primary key pair, and that would be very bad.</p>
<p>Instead of using “id_rsa”, you should use something like “id_rsa_github_useraccount” to denote the purpose of the key. So ultimately, you would enter:</p>
<pre>
<code>/Users/tom/.ssh/id_rsa_github_useraccount</code>
</pre>
<h2>Placing the Public and Private Keys</h2>
<h3>Private Key</h3>
<p>You will not actually be putting the private key anywhere, but instead only referencing it. For this, you will need to open the <span class="caps">SSH</span> config (~/.ssh/config) file in your favorite editor. Once in this file, you should add the following:</p>
<pre>
<code>
# GitHub for cylence
Host github-tom
HostName github.com
User git
IdentityFile /Users/tom/.ssh/id_rsa_git_tom
</code>
</pre>
<p>The top line is a simple comment, you can leave this out of you choose. Next is the name of the Host, this is what you will use when referencing this connection and after the word “Host” followed by a space is completely arbitrary. The HostName must be “github.com” as is the same with the User.Notice that it is still “git” and not an account name. Lastly, the IdentityFile line must contain a non-reative path to your newly created private key (NOT ending with .pub).</p>
<h3>Public Key</h3>
<p>Once the private key is properly being referenced, you must tell GitHub what the public key is. You do this by accessing your <a href="https://github.com/account">account page</a> on GitHub. Place your public key (including the carriage return at the end) into the “SSH Public Keys” textarea field.</p>
<h2>Using the Newly Created Keys</h2>
<p>From here on, everything is the same except for one component. To present an example, we will look at a standard clone command.</p>
<pre>
<code>
git clone git@github.com:account/repository.git
</code>
</pre>
<p>Traditionally, this command consists of “git clone”, the command to be performed, followed by a mostly ordinary ssh connection.</p>
<pre>
<code>
user@domain:path/somewhere/file.extension
</code>
</pre>
<p>What we will be changing is the domain portion of this line. Instead of using the domain “github.com”, we will be specifying the pre-configured <span class="caps">SSH</span> connection we built earlier. It is referenced using the Host line. Using our previous example, the end result would look like this:</p>
<pre>
<code>
git clone git@github-tom:account/repository.git
</code>
</pre>
<p>Thanks to <a href="https://github.com/mojombo">mojombo</a> for originally assisting me with this issue.</p>
<h2> Note: if you are running keychain to manage your <span class="caps">SSH</span> keys you may need to stop ssh-agent and add the new key to your keyring for it to work properly. If you are seeing failed access to your repositories as your other user, even though you’re configured to use the new key with your correct user you may wish to give this a try. On <span class="caps">OSX</span> Leopard is built in keychain integration, so either don’t store your passphrase in keychain or don’t use passphrase for your private key at all.</h2>
rorcraft
rex@rorcraft.com
tag:github.com,2008:Guide/42
2008-04-24T16:24:28-07:00
2008-08-01T15:40:48-07:00
Multiple GitHub Accounts - version 8
Fri Aug 01 15:40:48 -0700 2008
<p style="background:#fefeb4;border:1px solid #dddddd;font-weight:bold;;">The solution detailed in this guide is fairly complex and may not be ideal for most users.<br />
We recommend you check out the solutions detailed in <a href="https://github.com/guides/managing-multiple-clients-and-their-repositories">Managing multiple clients and their repositories</a> first.</p>
<h2>The Problem</h2>
<p>One might encounter a situation where two GitHub accounts might be necessary. Naturally, I mean two <strong>pay</strong> accounts in order to remain in good standing according to the <span class="caps">TOS</span> (or one free and one pay account). And we all want to stay in good standing with GitHub since they were awesome enough to make this great web application, right? Nevertheless, with that said, one might find one’s self in this situation.</p>
<p>A problem that one is likely to encounter in this situation is attempting to maintain two or more repositories that use more than one GitHub account. Using the default public/private key setup that GitHub suggests works great when only one account is involved, but when one attempts to clone a repository using a second account, by default, git attempts to use the first account, which is likely declined resulting in failure.</p>
<p>This article is assuming that you already have two git accounts created and that you already have the first <a href="https://github.com/guides/providing-your-ssh-key">key pair</a> in place on both your local system and on GitHub.</p>
<h2>Generating a Second Key Pair</h2>
<p>Read this section <span class="caps">COMPLETELY</span> before actually doing anything. You could easily get yourself into a lot of trouble if you do not. GitHub identifies which account you are attempting to access by the <span class="caps">SSH</span> key that you give it. To this end, you cannot use the same key pair for more than one GitHub account. You will need to follow the instructions given in the guide entitled <a href="https://github.com/guides/providing-your-ssh-key">Providing your <span class="caps">SSH</span> Key</a>. I think it would be unwise to reproduce part of that guide here.</p>
<p>Upon executing the ssh-keygen command, you will be presented with a prompt similar to the following:</p>
<pre>
<code>Enter file in which to save the key (/Users/tom/.ssh/id_rsa):</code>
</pre>
<p><b><span class="caps">WARNING</span></b>: If you already had a key pair and are using it for anything at all, do <span class="caps">NOT</span> leave this blank nor should you use the default file suggested. It will overwrite your primary key pair, and that would be very bad.</p>
<p>Instead of using “id_rsa”, you should use something like “id_rsa_github_useraccount” to denote the purpose of the key. So ultimately, you would enter:</p>
<pre>
<code>/Users/tom/.ssh/id_rsa_github_useraccount</code>
</pre>
<h2>Placing the Public and Private Keys</h2>
<h3>Private Key</h3>
<p>You will not actually be putting the private key anywhere, but instead only referencing it. For this, you will need to open the <span class="caps">SSH</span> config (~/.ssh/config) file in your favorite editor. Once in this file, you should add the following:</p>
<pre>
<code>
# GitHub for cylence
Host github-tom
HostName github.com
User git
IdentityFile /Users/tom/.ssh/id_rsa_git_tom
</code>
</pre>
<p>The top line is a simple comment, you can leave this out of you choose. Next is the name of the Host, this is what you will use when referencing this connection and after the word “Host” followed by a space is completely arbitrary. The HostName must be “github.com” as is the same with the User.Notice that it is still “git” and not an account name. Lastly, the IdentityFile line must contain a non-reative path to your newly created private key (NOT ending with .pub).</p>
<h3>Public Key</h3>
<p>Once the private key is properly being referenced, you must tell GitHub what the public key is. You do this by accessing your <a href="https://github.com/account">account page</a> on GitHub. Place your public key (including the carriage return at the end) into the “SSH Public Keys” textarea field.</p>
<h2>Using the Newly Created Keys</h2>
<p>From here on, everything is the same except for one component. To present an example, we will look at a standard clone command.</p>
<pre>
<code>
git clone git@github.com:account/repository.git
</code>
</pre>
<p>Traditionally, this command consists of “git clone”, the command to be performed, followed by a mostly ordinary ssh connection.</p>
<pre>
<code>
user@domain:path/somewhere/file.extension
</code>
</pre>
<p>What we will be changing is the domain portion of this line. Instead of using the domain “github.com”, we will be specifying the pre-configured <span class="caps">SSH</span> connection we built earlier. It is referenced using the Host line. Using our previous example, the end result would look like this:</p>
<pre>
<code>
git clone git@github-tom:account/repository.git
</code>
</pre>
<p>Thanks to <a href="https://github.com/mojombo">mojombo</a> for originally assisting me with this issue.</p>
<h2> Note: if you are running keychain to manage your <span class="caps">SSH</span> keys you may need to stop ssh-agent and add the new key to your keyring for it to work properly. If you are seeing failed access to your repositories as your other user, even though you’re configured to use the new key with your correct user you may wish to give this a try.</h2>
tekkub
tekkub@gmail.com
tag:github.com,2008:Guide/42
2008-04-24T16:24:28-07:00
2008-08-01T15:30:11-07:00
Multiple GitHub Accounts - version 7
Fri Aug 01 15:30:11 -0700 2008
<p style="background:#fefeb4;border:1px solid #dddddd;font-weight:bold;;">The solution detailed in this guide is fairly complex and may not be ideal for most users.<br />
We recommend you check out the solutions detailed in <span style="color:#aaa">Managing multiple clients and their reposotories</span><a href="https://github.com/guides/new?title=Managing+multiple+clients+and+their+reposotories">?</a> first.</p>
<h2>The Problem</h2>
<p>One might encounter a situation where two GitHub accounts might be necessary. Naturally, I mean two <strong>pay</strong> accounts in order to remain in good standing according to the <span class="caps">TOS</span> (or one free and one pay account). And we all want to stay in good standing with GitHub since they were awesome enough to make this great web application, right? Nevertheless, with that said, one might find one’s self in this situation.</p>
<p>A problem that one is likely to encounter in this situation is attempting to maintain two or more repositories that use more than one GitHub account. Using the default public/private key setup that GitHub suggests works great when only one account is involved, but when one attempts to clone a repository using a second account, by default, git attempts to use the first account, which is likely declined resulting in failure.</p>
<p>This article is assuming that you already have two git accounts created and that you already have the first <a href="https://github.com/guides/providing-your-ssh-key">key pair</a> in place on both your local system and on GitHub.</p>
<h2>Generating a Second Key Pair</h2>
<p>Read this section <span class="caps">COMPLETELY</span> before actually doing anything. You could easily get yourself into a lot of trouble if you do not. GitHub identifies which account you are attempting to access by the <span class="caps">SSH</span> key that you give it. To this end, you cannot use the same key pair for more than one GitHub account. You will need to follow the instructions given in the guide entitled <a href="https://github.com/guides/providing-your-ssh-key">Providing your <span class="caps">SSH</span> Key</a>. I think it would be unwise to reproduce part of that guide here.</p>
<p>Upon executing the ssh-keygen command, you will be presented with a prompt similar to the following:</p>
<pre>
<code>Enter file in which to save the key (/Users/tom/.ssh/id_rsa):</code>
</pre>
<p><b><span class="caps">WARNING</span></b>: If you already had a key pair and are using it for anything at all, do <span class="caps">NOT</span> leave this blank nor should you use the default file suggested. It will overwrite your primary key pair, and that would be very bad.</p>
<p>Instead of using “id_rsa”, you should use something like “id_rsa_github_useraccount” to denote the purpose of the key. So ultimately, you would enter:</p>
<pre>
<code>/Users/tom/.ssh/id_rsa_github_useraccount</code>
</pre>
<h2>Placing the Public and Private Keys</h2>
<h3>Private Key</h3>
<p>You will not actually be putting the private key anywhere, but instead only referencing it. For this, you will need to open the <span class="caps">SSH</span> config (~/.ssh/config) file in your favorite editor. Once in this file, you should add the following:</p>
<pre>
<code>
# GitHub for cylence
Host github-tom
HostName github.com
User git
IdentityFile /Users/tom/.ssh/id_rsa_git_tom
</code>
</pre>
<p>The top line is a simple comment, you can leave this out of you choose. Next is the name of the Host, this is what you will use when referencing this connection and after the word “Host” followed by a space is completely arbitrary. The HostName must be “github.com” as is the same with the User.Notice that it is still “git” and not an account name. Lastly, the IdentityFile line must contain a non-reative path to your newly created private key (NOT ending with .pub).</p>
<h3>Public Key</h3>
<p>Once the private key is properly being referenced, you must tell GitHub what the public key is. You do this by accessing your <a href="https://github.com/account">account page</a> on GitHub. Place your public key (including the carriage return at the end) into the “SSH Public Keys” textarea field.</p>
<h2>Using the Newly Created Keys</h2>
<p>From here on, everything is the same except for one component. To present an example, we will look at a standard clone command.</p>
<pre>
<code>
git clone git@github.com:account/repository.git
</code>
</pre>
<p>Traditionally, this command consists of “git clone”, the command to be performed, followed by a mostly ordinary ssh connection.</p>
<pre>
<code>
user@domain:path/somewhere/file.extension
</code>
</pre>
<p>What we will be changing is the domain portion of this line. Instead of using the domain “github.com”, we will be specifying the pre-configured <span class="caps">SSH</span> connection we built earlier. It is referenced using the Host line. Using our previous example, the end result would look like this:</p>
<pre>
<code>
git clone git@github-tom:account/repository.git
</code>
</pre>
<p>Thanks to <a href="https://github.com/mojombo">mojombo</a> for originally assisting me with this issue.</p>
<h2> Note: if you are running keychain to manage your <span class="caps">SSH</span> keys you may need to stop ssh-agent and add the new key to your keyring for it to work properly. If you are seeing failed access to your repositories as your other user, even though you’re configured to use the new key with your correct user you may wish to give this a try.</h2>
tekkub
tekkub@gmail.com
tag:github.com,2008:Guide/42
2008-04-24T16:24:28-07:00
2008-06-17T00:30:57-07:00
Multiple GitHub Accounts - version 6
Tue Jun 17 00:30:57 -0700 2008
<h2>The Problem</h2>
<p>One might encounter a situation where two GitHub accounts might be necessary. Naturally, I mean two <strong>pay</strong> accounts in order to remain in good standing according to the <span class="caps">TOS</span> (or one free and one pay account). And we all want to stay in good standing with GitHub since they were awesome enough to make this great web application, right? Nevertheless, with that said, one might find one’s self in this situation.</p>
<p>A problem that one is likely to encounter in this situation is attempting to maintain two or more repositories that use more than one GitHub account. Using the default public/private key setup that GitHub suggests works great when only one account is involved, but when one attempts to clone a repository using a second account, by default, git attempts to use the first account, which is likely declined resulting in failure.</p>
<p>This article is assuming that you already have two git accounts created and that you already have the first <a href="https://github.com/guides/providing-your-ssh-key">key pair</a> in place on both your local system and on GitHub.</p>
<h2>Generating a Second Key Pair</h2>
<p>Read this section <span class="caps">COMPLETELY</span> before actually doing anything. You could easily get yourself into a lot of trouble if you do not. GitHub identifies which account you are attempting to access by the <span class="caps">SSH</span> key that you give it. To this end, you cannot use the same key pair for more than one GitHub account. You will need to follow the instructions given in the guide entitled <a href="https://github.com/guides/providing-your-ssh-key">Providing your <span class="caps">SSH</span> Key</a>. I think it would be unwise to reproduce part of that guide here.</p>
<p>Upon executing the ssh-keygen command, you will be presented with a prompt similar to the following:</p>
<pre>
<code>Enter file in which to save the key (/Users/tom/.ssh/id_rsa):</code>
</pre>
<p><b><span class="caps">WARNING</span></b>: If you already had a key pair and are using it for anything at all, do <span class="caps">NOT</span> leave this blank nor should you use the default file suggested. It will overwrite your primary key pair, and that would be very bad.</p>
<p>Instead of using “id_rsa”, you should use something like “id_rsa_github_useraccount” to denote the purpose of the key. So ultimately, you would enter:</p>
<pre>
<code>/Users/tom/.ssh/id_rsa_github_useraccount</code>
</pre>
<h2>Placing the Public and Private Keys</h2>
<h3>Private Key</h3>
<p>You will not actually be putting the private key anywhere, but instead only referencing it. For this, you will need to open the <span class="caps">SSH</span> config (~/.ssh/config) file in your favorite editor. Once in this file, you should add the following:</p>
<pre>
<code>
# GitHub for cylence
Host github-tom
HostName github.com
User git
IdentityFile /Users/tom/.ssh/id_rsa_git_tom
</code>
</pre>
<p>The top line is a simple comment, you can leave this out of you choose. Next is the name of the Host, this is what you will use when referencing this connection and after the word “Host” followed by a space is completely arbitrary. The HostName must be “github.com” as is the same with the User.Notice that it is still “git” and not an account name. Lastly, the IdentityFile line must contain a non-reative path to your newly created private key (NOT ending with .pub).</p>
<h3>Public Key</h3>
<p>Once the private key is properly being referenced, you must tell GitHub what the public key is. You do this by accessing your <a href="https://github.com/account">account page</a> on GitHub. Place your public key (including the carriage return at the end) into the “SSH Public Keys” textarea field.</p>
<h2>Using the Newly Created Keys</h2>
<p>From here on, everything is the same except for one component. To present an example, we will look at a standard clone command.</p>
<pre>
<code>
git clone git@github.com:account/repository.git
</code>
</pre>
<p>Traditionally, this command consists of “git clone”, the command to be performed, followed by a mostly ordinary ssh connection.</p>
<pre>
<code>
user@domain:path/somewhere/file.extension
</code>
</pre>
<p>What we will be changing is the domain portion of this line. Instead of using the domain “github.com”, we will be specifying the pre-configured <span class="caps">SSH</span> connection we built earlier. It is referenced using the Host line. Using our previous example, the end result would look like this:</p>
<pre>
<code>
git clone git@github-tom:account/repository.git
</code>
</pre>
<p>Thanks to <a href="https://github.com/mojombo">mojombo</a> for originally assisting me with this issue.</p>
<h2> Note: if you are running keychain to manage your <span class="caps">SSH</span> keys you may need to stop ssh-agent and add the new key to your keyring for it to work properly. If you are seeing failed access to your repositories as your other user, even though you’re configured to use the new key with your correct user you may wish to give this a try.</h2>
orgsync
matt@orgsync.com
tag:github.com,2008:Guide/42
2008-04-24T16:24:28-07:00
2008-06-05T02:51:53-07:00
Multiple GitHub Accounts - version 5
Thu Jun 05 02:51:53 -0700 2008
<h2>The Problem</h2>
<p>One might encounter a situation where two GitHub accounts might be necessary. Naturally, I mean two <strong>pay</strong> accounts in order to remain in good standing according to the <span class="caps">TOS</span> (or one free and one pay account). And we all want to stay in good standing with GitHub since they were awesome enough to make this great web application, right? Nevertheless, with that said, one might find one’s self in this situation.</p>
<p>A problem that one is likely to encounter in this situation is attempting to maintain two or more repositories that use more than one GitHub account. Using the default public/private key setup that GitHub suggestions works great when only one account is involved, but when one attempts to clone a repository using a second account, by default, git attempts to use the first account, which is likely declined resulting in failure.</p>
<p>This article is assuming that you already have two git accounts created and that you already have the first <a href="https://github.com/guides/providing-your-ssh-key">key pair</a> in place on both your local system and on GitHub.</p>
<h2>Generating a Second Key Pair</h2>
<p>Read this section <span class="caps">COMPLETELY</span> before actually doing anything. You could easily get yourself into a lot of trouble if you do not. GitHub identifies which account you are attempting to access by the <span class="caps">SSH</span> key that you give it. To this end, you cannot use the same key pair for more than one GitHub account. You will need to follow the instructions given in the guide entitled <a href="https://github.com/guides/providing-your-ssh-key">Providing your <span class="caps">SSH</span> Key</a>. I think it would be unwise to reproduce part of that guide here.</p>
<p>Upon executing the ssh-keygen command, you will be presented with a prompt similar to the following:</p>
<pre>
<code>Enter file in which to save the key (/Users/tom/.ssh/id_rsa):</code>
</pre>
<p><b><span class="caps">WARNING</span></b>: If you already had a key pair and are using it for anything at all, do <span class="caps">NOT</span> leave this blank nor should you use the default file suggested. It will overwrite your primary key pair, and that would be very bad.</p>
<p>Instead of using “id_rsa”, you should use something like “id_rsa_github_useraccount” to denote the purpose of the key. So ultimately, you would enter:</p>
<pre>
<code>/Users/tom/.ssh/id_rsa_github_useraccount</code>
</pre>
<h2>Placing the Public and Private Keys</h2>
<h3>Private Key</h3>
<p>You will not actually be putting the private key anywhere, but instead only referencing it. For this, you will need to open the <span class="caps">SSH</span> config (~/.ssh/config) file in your favorite editor. Once in this file, you should add the following:</p>
<pre>
<code>
# GitHub for cylence
Host github-tom
HostName github.com
User git
IdentityFile /Users/tom/.ssh/id_rsa_git_tom
</code>
</pre>
<p>The top line is a simple comment, you can leave this out of you choose. Next is the name of the Host, this is what you will use when referencing this connection and after the word “Host” followed by a space is completely arbitrary. The HostName must be “github.com” as is the same with the User.Notice that it is still “git” and not an account name. Lastly, the IdentityFile line must contain a non-reative path to your newly created private key (NOT ending with .pub).</p>
<h3>Public Key</h3>
<p>Once the private key is properly being referenced, you must tell GitHub what the public key is. You do this by accessing your <a href="https://github.com/account">account page</a> on GitHub. Place your public key (including the carriage return at the end) into the “SSH Public Keys” textarea field.</p>
<h2>Using the Newly Created Keys</h2>
<p>From here on, everything is the same except for one component. To present an example, we will look at a standard clone command.</p>
<pre>
<code>
git clone git@github.com:account/repository.git
</code>
</pre>
<p>Traditionally, this command consists of “git clone”, the command to be performed, followed by a mostly ordinary ssh connection.</p>
<pre>
<code>
user@domain:path/somewhere/file.extension
</code>
</pre>
<p>What we will be changing is the domain portion of this line. Instead of using the domain “github.com”, we will be specifying the pre-configured <span class="caps">SSH</span> connection we built earlier. It is referenced using the Host line. Using our previous example, the end result would look like this:</p>
<pre>
<code>
git clone git@github-tom:account/repository.git
</code>
</pre>
<p>Thanks to <a href="https://github.com/mojombo">mojombo</a> for originally assisting me with this issue.</p>
<h2> Note: if you are running keychain to manage your <span class="caps">SSH</span> keys you may need to stop ssh-agent and add the new key to your keyring for it to work properly. If you are seeing failed access to your repositories as your other user, even though you’re configured to use the new key with your correct user you may wish to give this a try.</h2>
articulatedman
dev@articulatedman.com
tag:github.com,2008:Guide/42
2008-04-24T16:24:28-07:00
2008-06-05T02:47:59-07:00
Multiple GitHub Accounts - version 4
Thu Jun 05 02:47:59 -0700 2008
<h2>The Problem</h2>
<p>One might encounter a situation where two GitHub accounts might be necessary. Naturally, I mean two <strong>pay</strong> accounts in order to remain in good standing according to the <span class="caps">TOS</span> (or one free and one pay account). And we all want to stay in good standing with GitHub since they were awesome enough to make this great web application, right? Nevertheless, with that said, one might find one’s self in this situation.</p>
<p>A problem that one is likely to encounter in this situation is attempting to maintain two or more repositories that use more than one GitHub account. Using the default public/private key setup that GitHub suggestions works great when only one account is involved, but when one attempts to clone a repository using a second account, by default, git attempts to use the first account, which is likely declined resulting in failure.</p>
<p>This article is assuming that you already have two git accounts created and that you already have the first <a href="https://github.com/guides/providing-your-ssh-key">key pair</a> in place on both you local system and on GitHub.</p>
<h2>Generating a Second Key Pair</h2>
<p>Read this section <span class="caps">COMPLETELY</span> before actually doing anything. You could easily get yourself into a lot of trouble if you do not. GitHub identifies which account you are attempting to access by the <span class="caps">SSH</span> key that you give it. To this end, you cannot use the same key pair for more than one GitHub account. You will need to follow the instructions given in the guide entitled <a href="https://github.com/guides/providing-your-ssh-key">Providing your <span class="caps">SSH</span> Key</a>. I think it would be unwise to reproduce part of that guide here.</p>
<p>Upon executing the ssh-keygen command, you will be presented with a prompt similar to the following:</p>
<pre>
<code>Enter file in which to save the key (/Users/tom/.ssh/id_rsa):</code>
</pre>
<p><b><span class="caps">WARNING</span></b>: If you already had a key pair and are using it for anything at all, do <span class="caps">NOT</span> leave this blank nor should you use the default file suggested. It will overwrite your primary key pair, and that would be very bad.</p>
<p>Instead of using “id_rsa”, you should use something like “id_rsa_github_useraccount” to denote the purpose of the key. So ultimately, you would enter:</p>
<pre>
<code>/Users/tom/.ssh/id_rsa_github_useraccount</code>
</pre>
<h2>Placing the Public and Private Keys</h2>
<h3>Private Key</h3>
<p>You will not actually be putting the private key anywhere, but instead only referencing it. For this, you will need to open the <span class="caps">SSH</span> config (~/.ssh/config) file in your favorite editor. Once in this file, you should add the following:</p>
<pre>
<code>
# GitHub for cylence
Host github-tom
HostName github.com
User git
IdentityFile /Users/tom/.ssh/id_rsa_git_tom
</code>
</pre>
<p>The top line is a simple comment, you can leave this out of you choose. Next is the name of the Host, this is what you will use when referencing this connection and after the word “Host” followed by a space is completely arbitrary. The HostName must be “github.com” as is the same with the User.Notice that it is still “git” and not an account name. Lastly, the IdentityFile line must contain a non-reative path to your newly created private key (NOT ending with .pub).</p>
<h3>Public Key</h3>
<p>Once the private key is properly being referenced, you must tell GitHub what the public key is. You do this by accessing your <a href="https://github.com/account">account page</a> on GitHub. Place your public key (including the carriage return at the end) into the “SSH Public Keys” textarea field.</p>
<h2>Using the Newly Created Keys</h2>
<p>From here on, everything is the same except for one component. To present an example, we will look at a standard clone command.</p>
<pre>
<code>
git clone git@github.com:account/repository.git
</code>
</pre>
<p>Traditionally, this command consists of “git clone”, the command to be performed, followed by a mostly ordinary ssh connection.</p>
<pre>
<code>
user@domain:path/somewhere/file.extension
</code>
</pre>
<p>What we will be changing is the domain portion of this line. Instead of using the domain “github.com”, we will be specifying the pre-configured <span class="caps">SSH</span> connection we built earlier. It is referenced using the Host line. Using our previous example, the end result would look like this:</p>
<pre>
<code>
git clone git@github-tom:account/repository.git
</code>
</pre>
<p>Thanks to <a href="https://github.com/mojombo">mojombo</a> for originally assisting me with this issue.</p>
<h2> Note: if you are running keychain to manage your <span class="caps">SSH</span> keys you may need to stop ssh-agent and add the new key to your keyring for it to work properly. If you are seeing failed access to your repositories as your other user, even though you’re configured to use the new key with your correct user you may wish to give this a try.</h2>
articulatedman
dev@articulatedman.com
tag:github.com,2008:Guide/42
2008-04-24T16:24:28-07:00
2008-05-01T19:53:52-07:00
Multiple GitHub Accounts - version 3
Thu May 01 19:53:52 -0700 2008
<h2>The Problem</h2>
<p>One might encounter a situation where two GitHub accounts might be necessary. Naturally, I mean to <strong>pay</strong> accounts in order to remain in good standing according to the <span class="caps">TOS</span> (or one free and one pay account). And we all want to stay in good stading with GitHub since they were awesome enough to make this great web application, right? Nevertheless, with that said, one might find themself in this situation.</p>
<p>A problem that one is likely to encounter in this situation is attempting to maintain two or more repositories that use more than one GitHub account. Using the default public/private key setup that GitHub suggestions works great when only one account is involved, but when one attempts to clone a repository using a second account, by default, git attempts to use the first account, which is likely declined resulting in failure.</p>
<p>This article is assuming that you already have two git accounts created and that you already have the first <a href="https://github.com/guides/providing-your-ssh-key">key pair</a> in place on both you local system and on GitHub.</p>
<h2>Generating a Second Key Pair</h2>
<p>Read this section <span class="caps">COMPLETELY</span> before actually doing anything. You could easily get yourself into a lot of trouble if you do not. GitHub identifies which account you are attempting to access by the <span class="caps">SSH</span> key that you give it. To this end, you cannot use the same key pair for more than one GitHub account. You will need to follow the instructions given in the guide entitled <a href="https://github.com/guides/providing-your-ssh-key">Providing your <span class="caps">SSH</span> Key</a>. I think it would be unwise to reproduce part of that guide here.</p>
<p>Upon executing the ssh-keygen command, you will be presented with a prompt similar to the following:</p>
<pre>
<code>Enter file in which to save the key (/Users/tom/.ssh/id_rsa):</code>
</pre>
<p><b><span class="caps">WARNING</span></b>: If you already had a key pair and are using it for anything at all, do <span class="caps">NOT</span> leave this blank nor should you use the default file suggested. It will overwrite your primary key pair, and that would be very bad.</p>
<p>Instead of using “id_rsa”, you should use something like “id_rsa_github_useraccount” to denote the purpose of the key. So ultimately, you would enter:</p>
<pre>
<code>/Users/tom/.ssh/id_rsa_github_useraccount</code>
</pre>
<h2>Placing the Public and Private Keys</h2>
<h3>Private Key</h3>
<p>You will not actually be putting the private key anywhere, but instead only referencing it. For this, you will need to open the <span class="caps">SSH</span> config (~/.ssh/config) file in your favorite editor. Once in this file, you should add the following:</p>
<pre>
<code>
# GitHub for cylence
Host github-tom
HostName github.com
User git
IdentityFile /Users/tom/.ssh/id_rsa_git_tom
</code>
</pre>
<p>The top line is a simple comment, you can leave this out of you choose. Next is the name of the Host, this is what you will use when referencing this connection and after the word “Host” followed by a space is completely arbitrary. The HostName must be “github.com” as is the same with the User.Notice that it is still “git” and not an account name. Lastly, the IdentityFile line must contain a non-reative path to your newly created private key (NOT ending with .pub).</p>
<h3>Public Key</h3>
<p>Once the private key is properly being referenced, you must tell GitHub what the public key is. You do this by accessing your <a href="https://github.com/account">account page</a> on GitHub. Place your public key (including the carriage return at the end) into the “SSH Public Keys” textarea field.</p>
<h2>Using the Newly Created Keys</h2>
<p>From here on, everything is the same except for one component. To present an example, we will look at a standard clone command.</p>
<pre>
<code>
git clone git@github.com:account/repository.git
</code>
</pre>
<p>Traditionally, this command consists of “git clone”, the command to be performed, followed by a mostly ordinary ssh connection.</p>
<pre>
<code>
user@domain:path/somewhere/file.extension
</code>
</pre>
<p>What we will be changing is the domain portion of this line. Instead of using the domain “github.com”, we will be specifying the pre-configured <span class="caps">SSH</span> connection we built earlier. It is referenced using the Host line. Using our previous example, the end result would look like this:</p>
<pre>
<code>
git clone git@github-tom:account/repository.git
</code>
</pre>
<p>Thanks to <a href="https://github.com/mojombo">mojombo</a> for originally assisting me with this issue.</p>
<h2> Note: if you are running keychain to manage your <span class="caps">SSH</span> keys you may need to stop ssh-agent and add the new key to your keyring for it to work properly. If you are seeing failed access to your repositories as your other user, even though you’re configured to use the new key with your correct user you may wish to give this a try.</h2>
flogic
flogic@ogtastic.com
tag:github.com,2008:Guide/42
2008-04-24T16:24:28-07:00
2008-04-24T16:25:08-07:00
Multiple GitHub Accounts - version 2
Thu Apr 24 16:25:08 -0700 2008
<h2>The Problem</h2>
<p>One might encounter a situation where two GitHub accounts might be necessary. Naturally, I mean to <strong>pay</strong> accounts in order to remain in good standing according to the <span class="caps">TOS</span> (or one free and one pay account). And we all want to stay in good stading with GitHub since they were awesome enough to make this great web application, right? Nevertheless, with that said, one might find themself in this situation.</p>
<p>A problem that one is likely to encounter in this situation is attempting to maintain two or more repositories that use more than one GitHub account. Using the default public/private key setup that GitHub suggestions works great when only one account is involved, but when one attempts to clone a repository using a second account, by default, git attempts to use the first account, which is likely declined resulting in failure.</p>
<p>This article is assuming that you already have two git accounts created and that you already have the first <a href="https://github.com/guides/providing-your-ssh-key">key pair</a> in place on both you local system and on GitHub.</p>
<h2>Generating a Second Key Pair</h2>
<p>Read this section <span class="caps">COMPLETELY</span> before actually doing anything. You could easily get yourself into a lot of trouble if you do not. GitHub identifies which account you are attempting to access by the <span class="caps">SSH</span> key that you give it. To this end, you cannot use the same key pair for more than one GitHub account. You will need to follow the instructions given in the guide entitled <a href="https://github.com/guides/providing-your-ssh-key">Providing your <span class="caps">SSH</span> Key</a>. I think it would be unwise to reproduce part of that guide here.</p>
<p>Upon executing the ssh-keygen command, you will be presented with a prompt similar to the following:</p>
<pre>
<code>Enter file in which to save the key (/Users/tom/.ssh/id_rsa):</code>
</pre>
<p><b><span class="caps">WARNING</span></b>: If you already had a key pair and are using it for anything at all, do <span class="caps">NOT</span> leave this blank nor should you use the default file suggested. It will overwrite your primary key pair, and that would be very bad.</p>
<p>Instead of using “id_rsa”, you should use something like “id_rsa_github_useraccount” to denote the purpose of the key. So ultimately, you would enter:</p>
<pre>
<code>/Users/tom/.ssh/id_rsa_github_useraccount</code>
</pre>
<h2>Placing the Public and Private Keys</h2>
<h3>Private Key</h3>
<p>You will not actually be putting the private key anywhere, but instead only referencing it. For this, you will need to open the <span class="caps">SSH</span> config (~/.ssh/config) file in your favorite editor. Once in this file, you should add the following:</p>
<pre>
<code>
# GitHub for cylence
Host github-tom
HostName github.com
User git
IdentityFile /Users/tom/.ssh/id_rsa_git_tom
</code>
</pre>
<p>The top line is a simple comment, you can leave this out of you choose. Next is the name of the Host, this is what you will use when referencing this connection and after the word “Host” followed by a space is completely arbitrary. The HostName must be “github.com” as is the same with the User.Notice that it is still “git” and not an account name. Lastly, the IdentityFile line must contain a non-reative path to your newly created private key (NOT ending with .pub).</p>
<h3>Public Key</h3>
<p>Once the private key is properly being referenced, you must tell GitHub what the public key is. You do this by accessing your <a href="https://github.com/account">account page</a> on GitHub. Place your public key (including the carriage return at the end) into the “SSH Public Keys” textarea field.</p>
<h2>Using the Newly Created Keys</h2>
<p>From here on, everything is the same except for one component. To present an example, we will look at a standard clone command.</p>
<pre>
<code>
git clone git@github.com:account/repository.git
</code>
</pre>
<p>Traditionally, this command consists of “git clone”, the command to be performed, followed by a mostly ordinary ssh connection.</p>
<pre>
<code>
user@domain:path/somewhere/file.extension
</code>
</pre>
<p>What we will be changing is the domain portion of this line. Instead of using the domain “github.com”, we will be specifying the pre-configured <span class="caps">SSH</span> connection we built earlier. It is referenced using the Host line. Using our previous example, the end result would look like this:</p>
<pre>
<code>
git clone git@github-tom:account/repository.git
</code>
</pre>
<p>Thanks to <a href="https://github.com/mojombo">mojombo</a> for originally assisting me with this issue.</p>
cylence
rcross@cylenceweb.com
tag:github.com,2008:Guide/42
2008-04-24T16:24:28-07:00
2008-04-24T16:24:28-07:00
Multiple GitHub Accounts - version 1
Thu Apr 24 16:24:28 -0700 2008
<h2>The Problem</h2>
<p>One might encounter a situation where two GitHub accounts might be necessary. Naturally, I mean to <strong>pay</strong> accounts in order to remain in good standing according to the <span class="caps">TOS</span> (or one free and one pay account). And we all want to stay in good stading with GitHub since they were awesome enough to make this great web application, right? Nevertheless, with that said, one might find themself in this situation.</p>
<p>A problem that one is likely to encounter in this situation is attempting to maintain two or more repositories that use more than one GitHub account. Using the default public/private key setup that GitHub suggestions works great when only one account is involved, but when one attempts to clone a repository using a second account, by default, git attempts to use the first account, which is likely declined resulting in failure.</p>
<p>This article is assuming that you already have two git accounts created and that you already have the first <a href="https://github.com/guides/providing-your-ssh-key">key pair</a> in place on both you local system and on GitHub.</p>
<h2>Generating a Second Key Pair</h2>
<p>Read this section <span class="caps">COMPLETELY</span> before actually doing anything. You could easily get yourself into a lot of trouble if you do not. GitHub identifies which account you are attempting to access by the <span class="caps">SSH</span> key that you give it. To this end, you cannot use the same key pair for more than one GitHub account. You will need to follow the instructions given in the guide entitled <a href="https://github.com/guides/providing-your-ssh-key">Providing your <span class="caps">SSH</span> Key</a>. I think it would be unwise to reproduce part of that guide here.</p>
<p>Upon executing the ssh-keygen command, you will be presented with a prompt similar to the following:</p>
<pre>
<code>Enter file in which to save the key (/Users/tom/.ssh/id_rsa):</code>
</pre>
<p><b><span class="caps">WARNING</span></b>: If you already had a key pair and are using it for anything at all, do <span class="caps">NOT</span> leave this blank nor should you use the default file suggested. It will overwrite your primary key pair, and that would be very bad.</p>
<p>Instead of using “id_rsa”, you should use something like “id_rsa_github_useraccount” to denote the purpose of the key. So ultimately, you would enter:</p>
<pre>
<code>/Users/tom/.ssh/id_rsa_github_useraccount</code>
</pre>
<h2>Placing the Public and Private Keys</h2>
<h3>Private Key</h3>
<p>You will not actually be putting the private key anywhere, but instead only referencing it. For this, you will need to open the <span class="caps">SSH</span> config (~/.ssh/config) file in your favorite editor. Once in this file, you should add the following:</p>
<pre>
<code>
# GitHub for cylence
Host github-tom
HostName github.com
User git
IdentityFile /Users/ryan/.ssh/id_rsa_git_tom
</code>
</pre>
<p>The top line is a simple comment, you can leave this out of you choose. Next is the name of the Host, this is what you will use when referencing this connection and after the word “Host” followed by a space is completely arbitrary. The HostName must be “github.com” as is the same with the User.Notice that it is still “git” and not an account name. Lastly, the IdentityFile line must contain a non-reative path to your newly created private key (NOT ending with .pub).</p>
<h3>Public Key</h3>
<p>Once the private key is properly being referenced, you must tell GitHub what the public key is. You do this by accessing your <a href="https://github.com/account">account page</a> on GitHub. Place your public key (including the carriage return at the end) into the “SSH Public Keys” textarea field.</p>
<h2>Using the Newly Created Keys</h2>
<p>From here on, everything is the same except for one component. To present an example, we will look at a standard clone command.</p>
<pre>
<code>
git clone git@github.com:account/repository.git
</code>
</pre>
<p>Traditionally, this command consists of “git clone”, the command to be performed, followed by a mostly ordinary ssh connection.</p>
<pre>
<code>
user@domain:path/somewhere/file.extension
</code>
</pre>
<p>What we will be changing is the domain portion of this line. Instead of using the domain “github.com”, we will be specifying the pre-configured <span class="caps">SSH</span> connection we built earlier. It is referenced using the Host line. Using our previous example, the end result would look like this:</p>
<pre>
<code>
git clone git@github-tom:account/repository.git
</code>
</pre>
<p>Thanks to <a href="https://github.com/mojombo">mojombo</a> for originally assisting me with this issue.</p>
cylence
rcross@cylenceweb.com