mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-10 20:43:46 -05:00
A common practice for using multiple accounts with a hosting service
such as GitHub is to alias the host in ~/.ssh/config and use an
alternate ssh key to authenticate as the alternate user:
Host github.com-work
HostName github.com
IdentityFile ~/.ssh/id_rsa_work
By swapping in the original host name for the alias in
FugitiveRemoteUrl(), we can enable :GBrowse plugins to correctly
recognize the hosting service's domain name.
If for some reason you need the original URL without modification, pass
a true value as the third parameter:
let url = FugitiveRemoteUrl('', bufnr(''), 1)
References https://github.com/tpope/vim-rhubarb/issues/60