4

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
  • 53
  • 1
  • 7

1 Answers1

11
git checkout <old_branch>

git branch -m <new_branch>

git push origin -u <new_branch>
Chawki Messaoudi
  • 714
  • 2
  • 6
  • 18