Forked from Jonalogy/handling_multiple_github_accounts.md
Created
March 5, 2023 23:54
-
-
Save BrianCurliss/b9b990ade4bf5f8ad5a24f82457bd9b1 to your computer and use it in GitHub Desktop.
Revisions
-
Jonalogy revised this gist
Jun 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -47,7 +47,7 @@ Assuming you've got 2 github accounts, for work and play, lets get your Mac to _ > > Replace `user1` or `user2` with your GitHub usernames/identification-handlers #### 4. Go ahead to git clone your respective repository > `git clone [email protected]:user1/your-repo-name.git your-repo-name_user1` -
Jonalogy revised this gist
Jun 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ The only way I've succeeded so far is to employ SSH. Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH `config` file in a `.ssh` directory. The `config` file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into `.ssh` directory by default. You can navigate to it by running `cd ~/.ssh` within your terminal, open the `config` file with any editor, and it should look something like this: >```bash >Host * -
Jonalogy revised this gist
Jun 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,7 +25,7 @@ Assuming you've got 2 github accounts, for work and play, lets get your Mac to _ #### 2. Register your keys to the respective GitHub accounts. * Follow these [steps](https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/) to do so. #### 3. Head back over to the SSH `config` file at `~/.ssh` and amend accordingly to: -
Jonalogy revised this gist
Jun 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ The only way I've succeeded so far is to employ SSH. Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH `config` file in a `.ssh` directory. The `config` file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into `.ssh` directory by default. You can navigate to it by running `cd ~/.ssh` within your terminal, open the `config` file with any editor, and by default it should look something like this: >```bash >Host * -
Jonalogy revised this gist
Jun 22, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -52,7 +52,7 @@ Assuming you've got 2 github accounts, for work and play, lets get your Mac to _ > `git clone [email protected]:user1/your-repo-name.git your-repo-name_user1` #### 5. Configure your git identity: * Open up local git config using `git config --local -e` and add: >```bash >[user] @@ -62,7 +62,7 @@ Assuming you've got 2 github accounts, for work and play, lets get your Mac to _ #### 6. Ensure your remote url is in the right format e.g: `[email protected]:user1/your-repo-name.git your-repo-name_user1` * You either run `git remote set-url origin [email protected]:user1/your-repo-name.git your-repo-name_user1` * Or amend your remote ssh-url in your local git config file: > ```bash > [remote "origin"] > url = [email protected]:user1/your-repo-name.git -
Jonalogy revised this gist
Jun 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -47,7 +47,7 @@ Assuming you've got 2 github accounts, for work and play, lets get your Mac to _ > > Replace `user1` or `user2` with your GitHub usernames/identification-handlers #### 4. Go ahead to git clone the respective repository > `git clone [email protected]:user1/your-repo-name.git your-repo-name_user1` -
Jonalogy revised this gist
Jun 22, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -75,3 +75,5 @@ Now you can git actions (pull/push/fetch...etc) all you like! * [Automatically use correct SSH key for remote Git repo](https://www.keybits.net/post/automatically-use-correct-ssh-key-for-remote-git-repo/) * [StackOverFlow](https://stackoverflow.com/questions/7927750/specify-an-ssh-key-for-git-push-for-a-given-domain) * [Connecting to GitHub with SSH](https://help.github.com/articles/connecting-to-github-with-ssh/) _Special thanks to [@pbuditi](https://github.com/pbuditi) for your help!_ -
Jonalogy revised this gist
Jun 22, 2017 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,20 +14,20 @@ Assuming you are new to this like me, first I'd like to share with you that your Assuming you've got 2 github accounts, for work and play, lets get your Mac to _"register"_ them. To do that that you'll need to create SSH key pairs for each account. If you have already setup your Mac to SSH with one of them, [or check if you have one](https://help.github.com/articles/checking-for-existing-ssh-keys/), continue on with the following for the second account. #### 1. Creating the SSH keys. For each SSH key pairs: * run `ssh-keygen -t rsa -b 4096 -C "[email protected]"` * You'll be prompted: "Enter a file in which to save the key" and the suggested default filename would be `id_rsa`. This filename will be used for your SSH private and public keys so remember to make it unique, eg. `user-1`, `user-2`. This step will generate both the private and public keys, `user-1` + `user-1.pub` , `user-2` + `user-2.pub` respectively. * [GitHub](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/#generating-a-new-ssh-key) has this step in detail. We're not adding the keys to the ssh-agent. #### 2. Register your keys to the respective GitHub accounts. * Follow the [steps](https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/) here to do so. #### 3. Head back over to the SSH `config` file at `~/.ssh` and amend accordingly to: >```bash >#user1 account @@ -47,11 +47,11 @@ Assuming you've got 2 github accounts, for work and play, lets get your Mac to _ > > Replace `user1` or `user2` with your GitHub usernames/identification-handlers #### 4. Go ahead to git clone the respective GitHub account > `git clone [email protected]:user1/your-repo-name.git your-repo-name_user1` #### 5. Configure your git identity: * Open up local git config using `git config --local -e`and add: >```bash @@ -60,7 +60,7 @@ Assuming you've got 2 github accounts, for work and play, lets get your Mac to _ > email = [email protected] >``` #### 6. Ensure your remote url is in the right format e.g: `[email protected]:user1/your-repo-name.git your-repo-name_user1` * You either run `git remote set-url origin [email protected]:user1/your-repo-name.git your-repo-name_user1` * or amend your remote ssh-url in your local git config file: > ```bash @@ -71,7 +71,7 @@ Assuming you've got 2 github accounts, for work and play, lets get your Mac to _ Now you can git actions (pull/push/fetch...etc) all you like! #### Resources: * [Automatically use correct SSH key for remote Git repo](https://www.keybits.net/post/automatically-use-correct-ssh-key-for-remote-git-repo/) * [StackOverFlow](https://stackoverflow.com/questions/7927750/specify-an-ssh-key-for-git-push-for-a-given-domain) * [Connecting to GitHub with SSH](https://help.github.com/articles/connecting-to-github-with-ssh/) -
Jonalogy revised this gist
Jun 22, 2017 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -61,11 +61,11 @@ Assuming you've got 2 github accounts, for work and play, lets get your Mac to _ >``` **6. Ensure your remote url is in the right format e.g: `[email protected]:user1/your-repo-name.git your-repo-name_user1`** * You either run `git remote set-url origin [email protected]:user1/your-repo-name.git your-repo-name_user1` * or amend your remote ssh-url in your local git config file: > ```bash > [remote "origin"] > url = [email protected]user1:user1/your-repo-name.git > fetch = +refs/heads/*:refs/remotes/origin/* > ``` -
Jonalogy revised this gist
Jun 22, 2017 . 1 changed file with 10 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -60,10 +60,16 @@ Assuming you've got 2 github accounts, for work and play, lets get your Mac to _ > email = [email protected] >``` **6. Ensure your remote url is in the right format e.g: `[email protected]:user1/your-repo-name.git your-repo-name_user1`** * you either run `git remote set-url origin [email protected]:user1/your-repo-name.git your-repo-name_user1` * or you do so in your local git config file: > ```bash > [remote "origin"] > url = [email protected]:user-1/learn_mocha_chai.git > fetch = +refs/heads/*:refs/remotes/origin/* > ``` Now you can git actions (pull/push/fetch...etc) all you like! ### Resources: * [Automatically use correct SSH key for remote Git repo](https://www.keybits.net/post/automatically-use-correct-ssh-key-for-remote-git-repo/) -
Jonalogy revised this gist
Jun 22, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,6 +19,8 @@ Assuming you've got 2 github accounts, for work and play, lets get your Mac to _ * run `ssh-keygen -t rsa -b 4096 -C "[email protected]"` * You'll be prompted: "Enter a file in which to save the key" and the suggested default filename would be `id_rsa`. This filename will be used for your SSH private and public keys so remember to make it unique, eg. `user-1`, `user-2`. This step will generate both the private and public keys, `user-1` + `user-1.pub` , `user-2` + `user-2.pub` respectively. * [GitHub](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/#generating-a-new-ssh-key) has this step in detail. We're not adding the keys to the ssh-agent. **2. Register your keys to the respective GitHub accounts.** -
Jonalogy revised this gist
Jun 22, 2017 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Assuming you are new to this like me, first I'd like to share with you that your > ForwardAgent yes >``` Assuming you've got 2 github accounts, for work and play, lets get your Mac to _"register"_ them. To do that that you'll need to create SSH key pairs for each account. If you have already setup your Mac to SSH with one of them, [or check if you have one](https://help.github.com/articles/checking-for-existing-ssh-keys/), continue on with the following for the second account. **1. Creating the SSH keys. For each SSH key pairs:** @@ -22,7 +22,8 @@ Assuming you've got 2 github accounts, for work and play, lets get your Mac to _ **2. Register your keys to the respective GitHub accounts.** * Follow the [steps](https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/) here to do so. **3. Head back over to the SSH `config` file at `~/.ssh` and amend accordingly to:** -
Jonalogy revised this gist
Jun 22, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,11 +20,11 @@ Assuming you've got 2 github accounts, for work and play, lets get your Mac to _ * You'll be prompted: "Enter a file in which to save the key" and the suggested default filename would be `id_rsa`. This filename will be used for your SSH private and public keys so remember to make it unique, eg. `user-1`, `user-2`. This step will generate both the private and public keys, `user-1` + `user-1.pub` , `user-2` + `user-2.pub` respectively. **2. Register your keys to the respective GitHub accounts.** *Follow the [steps](https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/) here to do so. **3. Head back over to the SSH `config` file at `~/.ssh` and amend accordingly to:** >```bash >#user1 account -
Jonalogy revised this gist
Jun 22, 2017 . 1 changed file with 16 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,15 +14,15 @@ Assuming you are new to this like me, first I'd like to share with you that your Assuming you've got 2 github accounts, for work and play, lets get your Mac to _"register"_ them. To do that that you'll need to create SSH key pairs for each account. If you have already setup your Mac to SSH with one of them, continue on with the following for the second account. **1. Creating the SSH keys. For each SSH key pairs:** * run `ssh-keygen -t rsa -b 4096 -C "[email protected]"` * You'll be prompted: "Enter a file in which to save the key" and the suggested default filename would be `id_rsa`. This filename will be used for your SSH private and public keys so remember to make it unique, eg. `user-1`, `user-2`. This step will generate both the private and public keys, `user-1` + `user-1.pub` , `user-2` + `user-2.pub` respectively. *2. Register the contents of the public key, e.g `user-1.pub`, into the respective GitHub accounts.* *Follow the [steps](https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/) here to do so. *3. Head back over to the SSH `config` file at `~/.ssh` and amend accordingly to:* @@ -41,26 +41,28 @@ Assuming you've got 2 github accounts, for work and play, lets get your Mac to _ > IdentityFile ~/.ssh/github-user2 > IdentitiesOnly yes >``` > > Replace `user1` or `user2` with your GitHub usernames/identification-handlers **4. Go ahead to git clone the respective GitHub account** > `git clone [email protected]:user1/your-repo-name.git your-repo-name_user1` **5. Configure your git identity:** * Open up local git config using `git config --local -e`and add: >```bash >[user] > name = user1 > email = [email protected] >``` **6. Ensure your remote url is in the right format!** * `[email protected]:user1/your-repo-name.git your-repo-name_user1 Now you can git push and pull all you like! ### Resources: * [Automatically use correct SSH key for remote Git repo](https://www.keybits.net/post/automatically-use-correct-ssh-key-for-remote-git-repo/) * [StackOverFlow](https://stackoverflow.com/questions/7927750/specify-an-ssh-key-for-git-push-for-a-given-domain) * [Connecting to GitHub with SSH](https://help.github.com/articles/connecting-to-github-with-ssh/) -
Jonalogy revised this gist
Jun 22, 2017 . 1 changed file with 6 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ The only way I've succeeded so far is to employ SSH. Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH `config` file in a `.ssh` directory and this is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account. You can navigate to it by running `cd ~/.ssh` within your terminal, open the `config` file with any editor, and by default it should look something like this: >```bash >Host * @@ -14,15 +14,17 @@ Navigate to `~/.ssh` and open up the `config` file. By default, it should look s Assuming you've got 2 github accounts, for work and play, lets get your Mac to _"register"_ them. To do that that you'll need to create SSH key pairs for each account. If you have already setup your Mac to SSH with one of them, continue on with the following for the second account. *1. Creating the SSH keys. For each SSH key pairs:* * run `ssh-keygen -t rsa -b 4096 -C "[email protected]"` * You'll be prompted: "Enter a file in which to save the key" and the suggested default filename would be `id_rsa`. This filename will be used for your SSH private and public keys so remember to make it unique, eg. `user-1`. This step will generate both the private and public keys, `user-1` and `user-1.pub` respectively. *2. Register the contents of the public key, e.g `user-1.pub`, into the respective GitHub accounts.* *Follow the [steps](https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/) here to do so *3. Head back over to the SSH `config` file at `~/.ssh` and amend accordingly to:* >```bash >#user1 account -
Jonalogy revised this gist
Jun 22, 2017 . 1 changed file with 11 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,19 +4,21 @@ The only way I've succeeded so far is to employ SSH. Navigate to `~/.ssh` and open up the `config` file. By default, it should look something like this: >```bash >Host * > AddKeysToAgent yes > UseKeyChain yes > IdentityFile ~/.ssh/id_rsa > ForwardAgent yes >``` Assuming you've got 2 github accounts, for work and play, lets get your Mac to _"register"_ them. To do that that you'll need to create SSH key pairs for each account. If you have already setup your Mac to SSH with one of them, continue on with the following for the second account. 1. Creating the SSH keys. For each SSH key pairs: * run `ssh-keygen -t rsa -b 4096 -C "[email protected]"` * You'll be prompted: "Enter a file in which to save the key" and the suggested default filename would be `id_rsa`. This filename will be used for your SSH private and public keys so remember to make it unique, eg. `user-1`. This step will generate both the private and public keys, `user-1` and `user-1.pub` respectively. 2. Register the contents of the public key, e.g `user-1.pub`, into the respective GitHub accounts. Follow the [steps](https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/) here to do so -
Jonalogy revised this gist
Jun 22, 2017 . 1 changed file with 8 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,16 +1,16 @@ # Handling Multiple Github Accounts on MacOS The only way I've succeeded so far is to employ SSH. Navigate to `~/.ssh` and open up the `config` file. By default, it should look something like this: ```bash Host * AddKeysToAgent yes UseKeyChain yes IdentityFile ~/.ssh/id_rsa ForwardAgent yes ``` 1. In order for your Mac to be identified by two different GitHub accounts, you'll need to create SSH key pairs for each account. -
Jonalogy revised this gist
Jun 21, 2017 . 1 changed file with 21 additions and 16 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,26 +22,27 @@ Host * 3. Head back over to the SSH `config` file at `~/.ssh` and amend accordingly to: >```bash >#user1 account >Host github.com-user1 > HostName github.com > User git > IdentityFile ~/.ssh/github-user1 > IdentitiesOnly yes > >#user2 account >Host github.com-user2 > HostName github.com > User git > IdentityFile ~/.ssh/github-user2 > IdentitiesOnly yes >``` > > Replace `user1` or `user2` with your GitHub usernames 4. Go ahead to git clone the respective GitHub account > `git clone [email protected]:user1/your-repo-name.git your-repo-name_user1` 5. Configure your git identity: * open up local git config `git config --local -e`and add: @@ -55,3 +56,7 @@ Host * 6. Ensure your remote url is in the format of `[email protected]:user1/your-repo-name.git your-repo-name_user1` Now you can git push and pull all you like! ### Resources: * [Automatically use correct SSH key for remote Git repo](https://www.keybits.net/post/automatically-use-correct-ssh-key-for-remote-git-repo/) * [StackOverFlow](https://stackoverflow.com/questions/7927750/specify-an-ssh-key-for-git-push-for-a-given-domain) -
Jonalogy revised this gist
Jun 21, 2017 . 1 changed file with 14 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -40,5 +40,18 @@ Host * > > Replace `user1` or `user2` with your GitHub usernames 4. Go ahead to git clone the respective GitHub account > `git clone [email protected]:user1/your-repo-name.git your-repo-name_user1` 5. Configure your git identity: * open up local git config `git config --local -e`and add: ```bash [user] name = user1 email = [email protected] ``` 6. Ensure your remote url is in the format of `[email protected]:user1/your-repo-name.git your-repo-name_user1` Now you can git push and pull all you like! -
Jonalogy revised this gist
Jun 21, 2017 . 2 changed files with 44 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ # Handling Multiple Github Accounts on MacOS The only way I succeededd so far is to employ SSH keys. Navigate to `~/.ssh` and open up the `config` file. By default, it should look something like this: ```bash Host * AddKeysToAgent yes UseKeyChain yes IdentityFile ~/.ssh/id_rsa ForwardAgent yes ``` 1. In order for your Mac to be identified by two different GitHub accounts, you'll need to create SSH key pairs for each account. * run `ssh-keygen -t rsa -b 4096 -C "[email protected]"` * This will prompt "Enter a file in which to save the key". The default suggested filename would be `id_rsa`. Remember to name the new file differently if you have any existing one, eg. `user-1`. This will generate a private and public key, `user-1` and `user-1.pub`, respectively. 2. Register the contents of the public key, e.g `user-1.pub`, into the respective GitHub accounts. Follow the [steps](https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/) here to do so 3. Head back over to the SSH `config` file at `~/.ssh` and amend accordingly to: >```bash >>#user1 account >Host github.com-user1 > HostName github.com > User git > IdentityFile ~/.ssh/github-user1 > IdentitiesOnly yes > >#user2 account >Host github.com-user2 > HostName github.com > User git > IdentityFile ~/.ssh/github-user2 > IdentitiesOnly yes >``` > > Replace `user1` or `user2` with your GitHub usernames 4. Go ahead to git clone the respective github account > `git clone [email protected]:user1/your-repo-name.git your-repo-name_user1` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +0,0 @@ -
Jonalogy created this gist
Jun 21, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ # Handling Multiple Github Accounts on MacOS