How to setup multiple git accounts for GitHub and Bitbucket
Issue #514 Generate SSH keys ssh-keygen -t rsa -C "onmyway133@gmail.com" -f "id_rsa_github" ssh-keygen -t rsa -C "onmyway133bitbucket@gmail.com" -f "id_rsa_bitbucket" pbcopy < ~/.ssh/id_rsa_github.pub pbcopy < ~/.ssh/id_rsa_bitbucket.pub ssh-add -D ssh-add id_rsa_github ssh-add id_rsa_bitbucket vim ~/.ssh/config #Github (personal) Host gh HostName github.com User git IdentityFile ~/.ssh/id_rsa_github #Bitbucket (work) Host bb HostName bitbucket.org User git IdentityFile ~/.ssh/id_rsa_bitbucket Config git config --global user.email "onmyway133@gmail.com" git config --local user.email "onmyway133bitbucket@gmail.com" Read more https://medium.com/avocoders/github-and-bitbucket-accounts-in-a-same-pc-5f8c67fd89d2 https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-config Updated at 2020-10-04 06:52:07