Closed lindsayplatt closed 11 months ago
Programmatically deleted all the remote branches that are no longer needed.
Listing all branches, and those that match certain regex (or not -v)
-v
git branch -a git branch -a | grep "add*" git branch -a | grep -v "main"
Delete part of the branch name (can't have remotes/origin there when deleting)
remotes/origin
git branch -a | grep -v "main" | awk '{gsub("remotes/origin/", "")}1'
Delete remote branches (single and those in the list created using commands above)
git push origin -d <branch_name> git push origin -d `git_regex_command`
^ Logged the above as an issue so that I can find these commands again in the future!
Programmatically deleted all the remote branches that are no longer needed.
Listing all branches, and those that match certain regex (or not
-v
)Delete part of the branch name (can't have
remotes/origin
there when deleting)Delete remote branches (single and those in the list created using commands above)