diff --git a/.config/bash/.bash_profile b/.config/bash/.bash_profile index 208d0cc..5de5131 100644 --- a/.config/bash/.bash_profile +++ b/.config/bash/.bash_profile @@ -78,6 +78,12 @@ parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } +# delete local branches that don't exists in remote repository +git-prune() { + git fetch --prune + git branch -vv | grep '\[origin/.*: gone\]' | awk '{print $1}' | xargs git branch -d +} + # Set prompt color_prompt=yes