An oh-my-zsh assistant plugin for managing multiple git account with different ssh keys per repo.
When there are multiple git(hub) accounts with different ssh key bound; It is often trivial to handle with the keys.
One approach is to access the remote repo via GIT_SSH_COMMAND
, which would be like:
GIT_SSH_COMMAND="ssh -i /path/to/key/file" git pull origin xxx-branch
But if you do not want to type the environment variable every time, this plugin may help.
Each time when entering a folder which is a git repo
, this plugin reminds you to set an unique ssh key per-repo. The next time when accessing remote repos, specified keys will be leveraged.
Put ./git-ssh-helper/ folder under path: ${HOME}/.oh-my-zsh/custom/plugins/
Add plugin via .zshrc; inside the plugin section:
plugins=(... git-multi-sshacc-asst ...)
Restart the shell or run `source ${HOME}/.zshrc'