Git branch cleanup

by Wolfram Saringer  (2018-06-14)
last change: 2018-07-04


List branches:
git branches

Delete branch from remote 'origin':
git push -d origin <branch name>

Delete local branch:
git branch -d <branch name>

Rename current local branch:
git branch -n <new name>

Rename some local branch:
git branch -m <old name> <new name>

Rename remote branch after renaming local branch:
git push origin :<old name>
git push --set-upstream origin <new name>



all articles represent the sole opinion of their respective author. all content comes without any warranty for correctnes, despite due diligence.