Skip to content

Instantly share code, notes, and snippets.

@emyasnikov
Created March 26, 2023 20:53
Show Gist options
  • Save emyasnikov/34b8513bdb69007ca7c6ffd857716e77 to your computer and use it in GitHub Desktop.
Save emyasnikov/34b8513bdb69007ca7c6ffd857716e77 to your computer and use it in GitHub Desktop.
Git command to remove gone branches
[alias]
gone = ! "git fetch -p && git for-each-ref --format '%(refname:short) %(upstream:track)' | awk '$2 == \"[gone]\" {print $1}' | xargs -r git branch -D"
#!/bin/bash
git config --local include.path ../.gitconfig
@emyasnikov
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment