3

I don't want to rename a remote branch, as described in Rename master branch for both local and remote Git repositories.

How can I rename a local branch which hasn't been pushed to a remote branch?

In case you need to rename remote branch as well: How do I rename both a Git local and remote branch name

Acestus
  • 33
  • 1
  • 6

1 Answers1

6
git checkout <old_branch>

git branch -m <new_branch>

git push origin -u <new_branch>
Chawki Messaoudi
  • 587
  • 1
  • 4
  • 17