How do I list all remote git branches older than a year in a file?

Viewed 53

I found this snipped to list the not merged ones, but how do I list them, showing the date of last commit, author and all the ones older than a year?

for b in $(git branch --remote --no-merged); do
    git show $b --pretty="format:%ct $b" | head -n 1;
done | sort -n | cut -d ' ' -f 2 > unmerged-branches.txt
0 Answers
Related