Skip to content

Instantly share code, notes, and snippets.

@juyal-ahmed
Created August 30, 2018 09:24
Show Gist options
  • Select an option

  • Save juyal-ahmed/cada5c83b660bbeb7dd79f044e2a957c to your computer and use it in GitHub Desktop.

Select an option

Save juyal-ahmed/cada5c83b660bbeb7dd79f044e2a957c to your computer and use it in GitHub Desktop.
Multi Account Git
ssh-keygen -t rsa
ssh-add ~/.ssh/id_rsa

ssh-keygen -t rsa -C "companyName" -f "companyName"
ssh-add ~/.ssh/companyName
nano ~/.ssh/config
Host bitbucket.org
  HostName bitbucket.org
  IdentityFile ~/.ssh/id_rsa
Host companyname.bitbucket.org
  HostName bitbucket.org
  IdentityFile ~/.ssh/companyName
Host github.com
  HostName github.com
  IdentityFile ~/.ssh/id_rsa
Host companyname.github.com
  HostName github.com
  IdentityFile ~/.ssh/companyName
git clone git@bitbucket.org:yourPersonalAccount/pet-project.git
git clone git@bitbucket.org:companyName/company-project.git
git clone git@companyname.bitbucket.org:companyName/company-project.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment