Skip to content

Instantly share code, notes, and snippets.

View kevin93w's full-sized avatar

Kevin Wareman kevin93w

View GitHub Profile
@ba55ie
ba55ie / git-yolo.md
Created January 15, 2021 09:37
Git - Remove local branches that have been deleted on remote

Remove local branches that have been deleted on remote

Add the following command to [alias] section in your .gitconfig.

[alias]
  yolo = "!f() { git remote prune origin; git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -D; }; f"

Merged