From b2a9d0609de4c767ecec0de34bc826afb3954628 Mon Sep 17 00:00:00 2001 From: Jordan Last Date: Fri, 19 Jul 2024 11:52:38 -0500 Subject: [PATCH] add script to delete git branches --- scripts/delete_git_branches.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 scripts/delete_git_branches.sh diff --git a/scripts/delete_git_branches.sh b/scripts/delete_git_branches.sh new file mode 100755 index 0000000000..0745d42d1a --- /dev/null +++ b/scripts/delete_git_branches.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# List of branches to delete +branches=( + "my_branch1" + "my_branch2" +) + +# Function to delete branches locally and on GitHub +delete_branch() { + local branch=$1 + + git branch -d "$branch" + git push --delete origin "$branch" +} + +# Iterate over the branches and delete them +for branch in "${branches[@]}"; do + delete_branch "$branch" +done