Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 524 Bytes

File metadata and controls

15 lines (11 loc) · 524 Bytes

Git

Use this nice PowerShell one-liner to automatically clean up (delete) your local branches once your remote branches is deleted (merged).

git checkout main; git pull; git remote update origin --prune; git branch -vv | Select-String -Pattern ": gone]" | % { $_.toString().Trim().Split(" ")[0]} | % { git branch -D $_ }
git checkout main
git pull
git remote update origin --prune
git branch -vv | Select-String -Pattern ": gone]" | % { $_.toString().Trim().Split(" ")[0]} | % { git branch -D $_ }