I regularly have to delete a local and remote Git branch. Therefore, I run the following commands:
$ git branch -d feature-branch
$ git push --delete origin feature-branch
Since I mostly execute these two commands in a row, I would like to create an alias for them. Here is my approach:
alias gpdo='git branch -d $1 && git push --delete origin $1
However, this fails with the following error:
fatal: branch name required
&&
. You are simply mistaken.) – Wildcard Feb 10 '16 at 03:58