How to Rename a Branch in Gitlab



Guide

  1. To rename the branch name (bug-A, in this example) in the CLI, run the command git branch -m and then the current name of the branch (bug-A) followed by the new name of the branch (bug-B) and click Enter.

  2. Run command git branch.

  3. Notice that the branch name (bug-A) has now been newly renamed (bug-B) as seen in this repository.

🚀

Create your first interactive demo in minutes

No credit card required • Start building today

Start free

    This website uses cookies to enhance the user experience.

    AcceptDecline