Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

git remove untracked branches

# this is powershell script for Windows execution

git checkout master; 
git remote update origin --prune; 
git branch -vv | Select-String -Pattern ": gone]" | % { $_.toString().Trim().Split(" ")[0]} | % {git branch -d $_}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #git #remove #untracked #branches
ADD COMMENT
Topic
Name
8+2 =