Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pzinovkin/f36908bfdc2f63767861 to your computer and use it in GitHub Desktop.
Save pzinovkin/f36908bfdc2f63767861 to your computer and use it in GitHub Desktop.
# Credit http://stackoverflow.com/a/2514279
# List old branches
for branch in `git branch -r | grep -v HEAD | grep -v "origin/master"`;
do
echo -e `git show --format="%ci %cr %ae %an" $branch | head -n 1` \\t$branch;
done | sort -r
# Delete local remotes/origin/... branches not on the remote
git remote prune origin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment