我為 bash 和 zsh 定義了以下別名:
alias g=git
此外,在 git 中我配置了 git alias
alias.st status,以便我可以使用
g st.
現在我意識到在 zsh 中,gst(沒有空格)也可以作業。關于如何/為什么發生的任何想法?在 bash 中,相同的命令會導致Command 'gst' not found.
uj5u.com熱心網友回復:
我很久沒有使用 vanilla zsh 了,我個人認為 zsh 本身不知道該gst命令,除非您手動指定它。如果你使用流行的框架oh-my-zsh,它有一個 git 插件,它定義了大約 130 個額外的 git 別名,其中一些包含gst.
cat $HOME/.oh-my-zsh/plugins/git/git.plugin.zsh | grep "gst"
alias gst='git status'
alias gsta='git stash save'
alias gstaa='git stash apply'
alias gstc='git stash clear'
alias gstd='git stash drop'
alias gstl='git stash list'
alias gstp='git stash pop'
alias gsts='git stash show --text'
如果您從您的 啟用了這個插件.zshrc,那么默認情況下您也可以訪問這個別名(以及其他 129 個)。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/332852.html
上一篇:用戶將如何從瀏覽器使用GIT
