- Create a shell file
touch ~/del_branch.sh
- Put below into the file
#!/bin/bash
echo "exec $0"
set -x
branch_name = $1
git branch -D $1
git push --delete origin $1
- Append below into
~/.bash_profile
# shortcut
alias del_branch="~/del_branch.sh"
chmod u+r+x $del_branch
- Activation
source ~/.bash_profile
🙌Alright, all set, give it a shot🙌