Skip to content

Instantly share code, notes, and snippets.

@thedrewbisset
Last active December 1, 2017 01:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thedrewbisset/a94190f7c6b50e2f9e80ee80cd7b78a2 to your computer and use it in GitHub Desktop.
Save thedrewbisset/a94190f7c6b50e2f9e80ee80cd7b78a2 to your computer and use it in GitHub Desktop.
#!/bin/bash
remote=origin
author=Drew
date_pattern_to_exclude=2017-11
for branch in `git branch -r | grep -v HEAD `
do echo -e `git show --format="%ai %ar by %an" $branch | head -n 1` \\t$branch
done | grep $author | grep $remote | grep -v $date_pattern_to_exclude | awk {'print $10'} | sed -e 's/origin\///' | xargs -I {} git push origin :{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment