This interactive demo was created free with Storylane in 2 minutes. Create your own demo
This interactive demo was created free with Storylane in 2 minutes. Create your own demo
Start free
All Tutorials /Gitlab

How to Rename a Branch in Gitlab

Updated on:
May 12, 2026
By:
Madhav Bhandari
Use this interactive demo to learn how to rename a Git branch in GitLab via the CLI.

Quick summary

This tutorial shows how to rename a branch in GitLab using the git branch -m command in the CLI. In just a few steps, developers can update a branch name locally and confirm the change is reflected in their GitLab repository.


Steps

  1. In the CLI, run the command git branch -m followed by the current branch name (e.g., bug-A) and the new branch name (e.g., bug-B), then press Enter to execute the rename.
  2. Run the command git branch to list all branches and verify the rename was applied successfully.
  3. Confirm that the branch name (bug-A) has been renamed (bug-B) as reflected in the GitLab repository.

📌 Why this matters

Renaming a branch in GitLab is a common workflow task that keeps repositories organized and aligned with evolving project naming conventions. Using the git branch -m command in the CLI, developers can instantly update branch names without losing commit history or disrupting pull requests. This capability is essential for teams practicing GitFlow or maintaining clean, descriptive branch naming standards. Mastering branch management in GitLab helps development teams reduce confusion, improve code review efficiency, and maintain a scalable version control workflow.
Your product deserves an interactive demo
Start free
Similar Articles
Gitlab

How to Integrate Replit with GitLab

Madhav Bhandari
Director of Marketing @ Storylane
Gitlab

How to Create a Pull Request in GitLab

Madhav Bhandari
Director of Marketing @ Storylane
Gitlab

How to Integrate Snyk with GitLab

Madhav Bhandari
Director of Marketing @ Storylane
No items found.
Platform
Interactive Demos
Sandbox Demos
Buyer Hub
RepX
Integrations
Solutions
Product Marketers
Growth & Demand Gen
Sales Reps & AEs
Presales & SEs
Customer Success
Product Managers
Customers
Demo Showcase
Customer Stories
Finer Demos Club
Features
Demo Signals
Personalization
Deal Intelligence
Resources
Blog
The Plot
Tutorials
Help Docs
What’s New
Demo Dundies
Company
Careers
Pricing
Partners
Contact
Trust Center
Backed by
Chrome Extension Icon
Chrome extension
Download
Desktop app
Download
Built in San Francisco Bay Area - ©2026 Storylane
Privacy PolicyTerms & Conditions
X Corp (formerly Twitter)LinkedIn
This website uses cookies to ensure you get the best experience on our website. Learn More
Got it
This website uses cookies to ensure you get the best experience on our website. Learn More
Got it