Skip to content

Instantly share code, notes, and snippets.

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@ringate
ringate / order-uncancel.php
Created March 22, 2018 10:02 — forked from derak-kilgo/order-uncancel.php
One-off tool to uncancel an order in magento 1.x
<?php
if(php_sapi_name()!=="cli"){
echo "Must be run from the commend line.";
};
/**
* Setup a magento instance so we can run this export from the command line.
*/
require_once('app/Mage.php');
umask(0);
if (!Mage::isInstalled()) {
@ringate
ringate / multi-git.md
Created May 25, 2017 08:39 — forked from rosswd/multi-git-win.md
Setting up a Github and Bitbucket account on the same computer.

Setting up github and bitbucket on the same computer

Github will be the main account and bitbucket the secondary.

Create SSH Keys

ssh-keygen -t rsa -C "github email"

Enter passphrase when prompted. If you see an option to save the passphrase in your keychain, do it for an easier life.

@ringate
ringate / multiple_ssh_setting.md
Created May 25, 2017 08:15 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"