Add gdone zsh function

This commit is contained in:
Pavle Portic 2022-08-19 11:14:00 +02:00
parent ad53f8f674
commit 2df443cb35
Signed by: TheEdgeOfRage
GPG Key ID: 66AD4BA646FBC0D2
1 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,14 @@
# vim: ft=zsh
# Update and switch to master and delete current branch
current=$(git branch --show-current)
if [ "$current" == "$(git_main_branch)" ]; then
echo "Cannot delete $(git_main_branch) branch"
return 1
fi
git switch $(git_main_branch)
git fetch --all --prune --jobs=10
git branch -D $current
unset current