I have an alias which is predefined by an oh-my-zsh plugin.
-> % alias gcm
gcm='git checkout master'
I'd like to remove it, i.e. I'd like alias | pcregrep "\bgcm\b" return 1.
I've tried with alias gcm='' but after that the alias is still existent.
Asked
Active
Viewed 3.9k times
62
Gabor Marton
- 777
4 Answers
13
This other answer is correct but if you're adding the unalias gcm line to your .zshrc file, it must be done AFTER oh-my-zsh is sourced, or else it will be overwritten by the zsh defaults.
It would look something like the below in your .zshrc file:
source $ZSH/oh-my-zsh.sh
# must unalias all ZSH defaults here AFTER we source the above
unalias gcm
alias gcm="whatever you want"
Kamil Maciorowski
- 81,893
Ollie Murphy
- 231
2
For removing git aliases in zsh git plugin you can comment them out in ~/.oh-my-zsh/plugins/git/git.plugin.zsh which is default installation location for git plugin
1UC1F3R616
- 121