Skip to content

Instantly share code, notes, and snippets.

@loganlinn
Created August 14, 2012 20:46
Show Gist options
  • Save loganlinn/3352814 to your computer and use it in GitHub Desktop.
Save loganlinn/3352814 to your computer and use it in GitHub Desktop.
Git branch cleanup - older than 1 year, not matching 'release' or 'master'
git branch -r --merged master | sed 's/ *origin\///' | grep -v -E '(release|master$)' | xargs -I_ git log -1 --format='_ %ct' origin/_ | awk '{ if ($2 < '$(date -v-1y +%s)') print $1 }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment