自己最近一直在使用Oh My Zsh。今天我发现 Oh My Zsh附带的gds (alias)和我本地的一个命令冲突了,于是学习了一下解决冲 突的方法,在此记录下来。

在命令行中查看当前gds的含义:

$ which gds
gds: aliased to git diff --staged

~/.zshrc中加入如下语句取消gds设定:

# ~/.zshrc

# unset oh-my-zsh's gds which is alias to 'git diff --staged'
# so my /home/guosj/.local/bin/gds works instead
unalias gds

重载~/.zshrc:

$ . ~/.zshrc

再次查看gds的含义:

$ which gds
/home/guosj/.local/bin/gds

参考How to unset aliases set by Oh My Zsh

以上。