Git command that shows which remote branches have been pruned?

Answered
yaboy01 asked this question 11 months ago
yaboy01 on Mar 3, 2022

In my local repository, I ran git fetch --prune to remove all the branches that have been merged into master. And, therefore, no longer exist.

Is there a command that shows which remote branches have been merged and removed?

Thanks!

2 suggested answers
coderguy on Mar 3, 2022

Try this command:

git branch -vv

It will display gone next to any local branches that have been pruned from the remote repository.

0 replies
itsbambi on Mar 3, 2022

The git-removed-branches NPM package works well for this.

Install it globally:

npm install -g git-removed-branches

And use it like this:

git removed-branches

That will list the local branches that are no longer available on the remote repo.

You can remove them by adding the --prune flag:

git removed-branches --prune
0 replies
Answered