needleinthehay.de

Rename local and remote branch in Git

  1. Rename branch locally and push to remote:

    git branch -m <old-name> <new-name>
  2. Push new branch to remote

    git push origin -u <new-name>
  3. Delete old branch remote:

    git push origin -d <old-name>