Open Qingquan-Li opened 2 years ago
Simple script to work with 2 Git/GitHub in one terminal. The the tool allows to: create ssh keys, change between 2 accounts, verify the current account and test connection to github. https://github.com/PhilipMello/git-switch
1. Create SSH Key
Generate a unique SSH key for second GitHub account.
2. Add the New SSH key to the Second GitHub Account
Copy the SSH public key (
~/.ssh/id_ed25519_account2.pub
) to the second GitHub account: https://github.com/settings/keys3. Add the SSH Key to the Agent
4. Configure the
config
File5. Change Remote Repository URL
Use
git@github.com-account2
instead ofgit@github.com
6. Change (Local) Git Username and Email
If you have set the global config,
then you can change the
user.name
anduser.email
locally for the current repository.