Git prune local branches

For pruning of local branches that have been deleted on remote

git remote prune origin

For checking local branches and if they can be deleted because they have been merged into another branch already

git branch --merged >/tmp/merged-branches && \
  vi /tmp/merged-branches && xargs git branch -d </tmp/merged-branches

Clean local branches git

git branch --merged master | grep -v '^[ *]*master$' | xargs git branch -d

Git remove deleted remote branches

git fetch origin --prune
Please follow and like us:
Content Protection by DMCA.com