Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eacousineau/0642866e7acc0f396383b3b1c29c6362 to your computer and use it in GitHub Desktop.
Save eacousineau/0642866e7acc0f396383b3b1c29c6362 to your computer and use it in GitHub Desktop.
Using separate github accounts and keys
_DOTFILES=<DEFINE THIS>
use-personal-git() {
export GIT_AUTHOR_EMAIL=personal@email.com
export GIT_COMMITTER_EMAIL=${GIT_AUTHOR_EMAIL}
export GIT_SSH=${_DOTFILES}/ssh_personal_for_git.sh
export PS1="personal!$ "
}
#!/bin/bash
set -eu
# Ensure this is executable!
# chmod +x ./ssh_personal_for_git.sh
# Setup
# ssh-keygen -f ~/.ssh/id_rsa_github_personal.pem
# xcopy < ~/.ssh/id_rsa_github_personal.pem.pub
# Add as new SSH key
pem_github_personal=~/.ssh/id_rsa_github_personal.pem
exec ssh -i ${pem_github_personal} "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment