Skip to content

Instantly share code, notes, and snippets.

View mbean-epc's full-sized avatar

Michael B mbean-epc

View GitHub Profile
@cr0wg4n
cr0wg4n / switch-github-user.sh
Last active October 23, 2024 23:58
A Bash script to interchange multiple GitHub users in a unique machine
#!/bin/bash
gh_user="${1:-Nothing}"
if [ "$gh_user" == 'USERNAME_1' ]; then
ssh-add -D
git config --global user.email "USERNAME_1_EMAIL"
ssh-add /PRIVATE_KEY_PATH/.ssh/github-USERNAME_1
elif [ "$gh_user" == 'USERNAME_2' ]; then
ssh-add -D
git config --global user.email "USERNAME_2_EMAIL"