<@UQX3ZNU12>, what do you think about removing old...
# python-contributors
s
@Piotr Krzemiński, what do you think about removing old branches (like from 2020 and older) from our fork? For now we have around 3K branches and it makes them harder to use
p
if it won't make syncing from parent repo hard, then I'm 100% for it 🙂 we usually sync from master, so it shouldn't be a problem
s
Yep, I don't see any problems with syncing, because we just select a specific tag in the upstream and merge it to our default branch. The lack of branches shouldn't affect it
👍 1
Will take a look
Done. The following script worked (worked a couple of hours, found it at SO):
Copy code
for k in $(git branch -r | sed /\*/d); do
  if [ -z "$(git log -1 --since='Jan 1, 2021' -s $k)" ]; then
    branch_name_with_no_origin=$(echo $k | sed -e "s/origin\///")
    echo deleting branch: $branch_name_with_no_origin
    git push origin --delete $branch_name_with_no_origin
  fi
done
👍 1
By the way, few branches deletion failed with
dst refspec v1.3.0 matches more than one
. So removed them manually like that:
git push origin --delete refs/heads/v1.3.0