I use IntelliJ (2016.1.3) and GIT integration plugin (8.1). During my use of IntelliJ I checked out multiple branches. Now those branches are deleted from GIT (after each pull request we delete them).
From now on every branch I checked out once is present in my GIT view from Intellij (by VCS > Git > Branches...), see under :
There is a way to delete them : do it ... one by one ! But if there are a lot of branches (let say a hundred ...), it certainly getting tedious...
The question is : Do you know if there is a simple way to delete all the orphan local branches from this view in IntelliJ ?
Thanks :)
EDIT : I have found a way to delete them but in another tool : "Git Gui". When you delete it from there, it's deleted in IntelliJ too. And you can delete multiple branches at one time.
In the Branches popup or from the Branches pane of the Git tool window, right-click the branch you want to delete and choose Delete.
Use git prune to remove orphaned/unused branches If you see any branches in there that you don't want, you can use the command git branch -d <branch name> . If you want to delete the branch called badbranch, use the -D switch to force the deletion if it doesn't work: git branch -d badbranch .
The Intellij-Plugin GitToolBox offers an option called "Git branches cleanup" which does just what you appear to need.
Once installed, go to Git -> GitToolBox -> Git branches cleanup and select those branches you wish to delete.
To make deletion of a lot of branches a little less painful you may go to the git tool window (Hotkey Alt + 9). In the branches panel it is possible to select multiple branches and delete them.
So you do not have to delete them one by one. But be aware to not delete branches that are still of interest as you are not able to see the connection to remote branches or if this is pruned in this view.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With