Skip to content

Instantly share code, notes, and snippets.

@ibrahim12
Created April 30, 2020 23:00
Show Gist options
  • Save ibrahim12/ad9e0db45bde153979130c3cd724ebbe to your computer and use it in GitHub Desktop.
Save ibrahim12/ad9e0db45bde153979130c3cd724ebbe to your computer and use it in GitHub Desktop.
delete_x_days_old_git_branches
for k in $(git branch | sed /\*/d); do
if [[ ! $(git log -1 --since='2 weeks ago' -s $k) ]]; then
git branch -D $k
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment