Skip to content

Instantly share code, notes, and snippets.

@cdated
Last active September 10, 2015 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdated/0d98b6dbd7ee5324591f to your computer and use it in GitHub Desktop.
Save cdated/0d98b6dbd7ee5324591f to your computer and use it in GitHub Desktop.
Git branch cleanup
Rename branch
git branch -m <oldName> <newName>
Delete local branch
git branch -D <branchName>
Delete local and remote branch
git push origin --delete <branchName>
Delete remote reference from local repo
git branch -d -r origin/<branchName>
Delete all remote references that no longer exist on remote
git fetch -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment