Skip to content

Instantly share code, notes, and snippets.

@marco-carvalho
Last active January 27, 2022 00:13
Show Gist options
  • Save marco-carvalho/694fa8f98d2b1c93fa715eafd5463261 to your computer and use it in GitHub Desktop.
Save marco-carvalho/694fa8f98d2b1c93fa715eafd5463261 to your computer and use it in GitHub Desktop.
for k in $(git branch --sort=committerdate --remote | grep -o -P "(?<=origin\/)[^ ]+"); do
if [[ ! $(git log -1 --since='6 month ago' -s origin/$k) ]]; then
git push origin -d $k;
fi;
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment