convert git url to a http url
>>> git-url git@github.com/xxx/xxx.git
http://github.com/xxx/xxx
or enter a git repo
>>> git remote -v
origin git@github.com/xxx/xxx.git (fetch)
origin git@github.com/xxx/xxx.git (push)
>>> git-url
http://github.com/xxx/xxx
-
Clone this repository into
$ZSH_CUSTOM/plugins
(by default~/.oh-my-zsh/custom/plugins
)git clone https://github.com/xueyuelei/zsh-git-url ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-git-url
-
Add the plugin to the list of plugins for Oh My Zsh to load (inside
~/.zshrc
):plugins=( # other plugins... zsh-git-url )
-
Start a new terminal session.
-
Clone this repository somewhere on your machine. This guide will assume
~/.zsh/zsh-git-url
.git clone https://github.com/zsh-users/zsh-git-url ~/.zsh/zsh-git-url
-
Add the following to your
.zshrc
:source ~/.zsh/zsh-git-url/zsh-git-url.plugin.zsh
-
Start a new terminal session.