Skip to content

Instantly share code, notes, and snippets.

View skdubey's full-sized avatar

Sandeep Dubey skdubey

  • Pune
View GitHub Profile
@skdubey
skdubey / del_branch.sh
Created July 28, 2020 04:17
This script will pull all the branches from your Bitbucket repository of all the projects and their repositories, find the merged branches older than 30 days and delete it.
#!/bin/bash
## Get the list of all the projects from Bitbucket account across all the pages
get_total_project_list () {
start=0
total_project_list=()
is_last_page=false
while ! $is_last_page
do
response=$(curl -k -u $u -X GET -H "Content-type: application/json" $bitbucket_url/rest/api/1.0/projects?start=$start) 2>&1