Skip to content

Instantly share code, notes, and snippets.

View PedroCaicedoDev's full-sized avatar

Pedro Caicedo PedroCaicedoDev

View GitHub Profile
Match Exec "[[ $(git config --get remote.origin.url)'' == 'git@github.com:user_or_company'* ]]"
IdentityFile ~/.ssh/id_rsa_github_company
IdentitiesOnly yes
Host github.com
IdentityFile ~/.ssh/id_rsa_github
IdentitiesOnly yes
ForwardAgent no
ForwardX11 no
ForwardX11Trusted no
Host gitolite-as-alice
HostName git.company.com
User git
IdentityFile /home/whoever/.ssh/id_rsa.alice
IdentitiesOnly yes
Host gitolite-as-bob
HostName git.company.com
User git
IdentityFile /home/whoever/.ssh/id_dsa.bob
# Multi domain
Host gihub.com
User git
IdentityFile /home/whoever/.ssh/id_rsa_github
IdentitiesOnly yes
Host bitbucket.org
User git
IdentityFile /home/whoever/.ssh/id_dsa_bitbucket
export TERM="xterm-256color" # This sets up colors properly
# workaround as per https://superuser.com/questions/1222867/zsh-completion-functions-broken
FPATH=$HOME/.oh-my-zsh/plugins/git:$HOME/.oh-my-zsh/functions:$HOME/.oh-my-zsh/completions:/usr/share/zsh/site-functions:/usr/share/zsh/$ZSH_VERSION/functions
export FPATH
# set shell
export SHELL=/usr/bin/zsh