1

I would like to check which of my local branch are closed on remote server and remove them from my local list - is there such git (or any other e.g.bash) command?

My current flow:

  • git branch to list my local branches
  • log in to bitbucket/github/other git hosting service and check which branches are closed
  • delete branches locally with command: git branch -d branch_name

Any tips/help will be appreciated.

lukaszkups
  • 4,855
  • 8
  • 41
  • 73

1 Answers1

1

There is

git remote prune origin

That will remove remote branches that track branches on the remote that are no longer there. But it won't delete local branches.

You could clean out locally merged branches using the command suggested in this answer:

git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
Community
  • 1
  • 1
Klas Mellbourn
  • 35,589
  • 18
  • 119
  • 143
  • When I just wanted to comment that Your answer not exactly solves my problem You've edited it and now it works like a charm :) Thank You. – lukaszkups Jul 10 '14 at 10:18