jz-pva
Last Updated: November 01, 2018
·
50
· istisiki

Cleaning up your local git repo's branches

git

git remote prune origin
Removes tracking for branches that are no longer on remote. For this case remote is origin.

git branch --merged
Shows you a list of branches that have already beed merged to the current branch. These branches can be considered candidates for deletion.

git branch --delete <branch_name>
Deletes the local copy of the branch.

`git push origin --delete <branch_name>'
Deletes the remote copy of the branch. For this case, remote is origin.

Filed Under