Skip to content

A quick bash script to clean up remote and local branches

Notifications You must be signed in to change notification settings

dare892/git-branch-cleanup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Git Branch Cleanup

A quick bash script to clean up remote and local branches.

First make cleanup.sh file
#!/bin/bash
array=(
  placeholder-branch1
  placeholder-brach2
)
for i in "${array[@]}"
do
  echo "DELETING $i"
  git branch -D $i
  git push origin --delete $i
done
In the array section, get rid of placeholders and replace it with your branches on the repo. In order to view your branches, do
$ git branch
After you save, change permissions
chmod +x cleanup.sh
Run the script
using ./cleanup.sh

About

A quick bash script to clean up remote and local branches

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published