Skip to content

Instantly share code, notes, and snippets.

View srih4ri's full-sized avatar
🔥
Lighting things on fire, brb

Srihari srih4ri

🔥
Lighting things on fire, brb
View GitHub Profile
@srih4ri
srih4ri / delete_branches_older_than.sh
Created May 20, 2020 15:01 — forked from vasuadari/delete_branches_older_than.sh
Script to delete branches older than a certain date, modification of 4586456
# Copy of https://gist.github.com/antonio/4586456
# With a modification to collect all the branch names so we can make one git request
# Set DRY_RUN=1 to get an echo of the command
# Format that works with `git log --since`, e.g. 2018-01-01
date=$1
branches=
for branch in $(git branch -r | sed 's/^\s*//' | sed 's/^remotes\///' | grep -v 'master$'); do