|
|
|
|
|
by joshbode
895 days ago
|
|
Another trick I find useful for managing Git over SSH for multiple accounts (especially with bitbucket.org, which supports specifying different usernames) is the "Match exec" directive which allows you to include a shell (bash) conditional (such as a directory-check), e.g. Match originalhost bitbucket.org exec "[[ ${PWD}/ == ${HOME}/repos/work/* ]]"
IdentityFile ~/.ssh/keys/work
User me-work
Match originalhost bitbucket.org exec "[[ ${PWD}/ == ${HOME}/repos/personal/* ]]"
IdentityFile ~/.ssh/keys/personal
User me
|
|