ck_9wq
Last Updated: February 25, 2016
·
822
· nicolaslazartekaqui
Img 3566

Git - Cleaning old branches with prune

git

Assuming the project has many branches

$ git branch -a

* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/other-branch

when in remote a branch is removed, your project keep this branch in a history of remote branches

$ git push --delete origin other-branch

$ git branch -a

* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/other-branch

to clean up the old branches of your listing, you can do

$ git remote prune origin

* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
Say Thanks
Respond
Filed Under