Skip to content

Instantly share code, notes, and snippets.

@cakriwut
Created August 22, 2016 23:58
Show Gist options
  • Save cakriwut/85728034f3863863470eb8ef54b6a672 to your computer and use it in GitHub Desktop.
Save cakriwut/85728034f3863863470eb8ef54b6a672 to your computer and use it in GitHub Desktop.
Rename git branch
REM rename branch in local
git branch -m old_branch new_branch
REM delete old branch in ORIGIN
git push origin :old_branch
REM set new branch to track ORIGIN
git push --set-upstream origin new_branch
REM re-sync remote branch to local, removing deleted remote
git fetch origin --prune
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment