Skip to content

Commit

Permalink
Merge pull request #1924 from demergent-labs/delete_git_branches
Browse files Browse the repository at this point in the history
add script to delete git branches
  • Loading branch information
lastmjs authored Aug 6, 2024
2 parents 5439b27 + b2a9d06 commit ebc6e70
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions scripts/delete_git_branches.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ebc6e70

Please sign in to comment.