I'm fairly new to git and I wanted to have an alias for this command but I'm having some trouble.
git fetch -p &&git branch -vv|grep ': gone]'|awk '{print $1}'|xargs git branch -D
This is a function from the question here. Remove local branches no longer on remote
The function works perfectly for me, but when I try to put it in an alias, it runs but doesn't work. Any suggestions would be greatly appreciated. This is what it looks like in my config.
[alias]
deletedone = "!f() { git fetch -p &&git branch -vv|grep ': gone]'|awk '{print $1}'|xargs git branch -D;}"