Home > database >  zsh custom function breaks
zsh custom function breaks

Time:01-09

I'm new to zsh and struggling with this simplest function which worked perfectly for me in bash. I'm adding it to .zshrc file.

function gcp {
    git add .
    git commit -am "$@"
    git push
}

But when I call it, I get:

gcp "Update mac deps"
fatal: bad revision 'Update mac deps'

UPD: uhhh that's because of for some reason:

which gcp
gcp: aliased to git cherry-pick

UPD2: okay, the problem was that oh-my-zsh ships with a ton of built-in git aliases, so the solution - I just had comment out gcp one from ~/.oh-my-zsh/plugins/git/git.plugin.zsh.

CodePudding user response:

Most likely a commit in your Clone has not been updated. Please git pull origin/master it out and then git checkout <branch> to resolve this issue.

CodePudding user response:

Okay, the problem was that oh-my-zsh ships with a ton of built-in git aliases, so the solution - I just had comment out gcp one from ~/.oh-my-zsh/plugins/git/git.plugin.zsh.

  •  Tags:  
  • Related