To change the name of the name of a Git ranme branch, you can use the following command using git branch -m . The name change of this branch you’re watching to the name you have specified. You don’t have to provide the branch’s old name if you are looking to change the name of the branch that you are looking at.
How to rename an Git Branch
Have you ever found yourself in a situation where the name of the branch is no anymore important? Are you aware of a mistake in the name of branch that you can’t forget about? Good news: Git allows you to name the branch.
In this guide we’ll be talking about how to change the name of an Git branch. We’ll show you an example of changing the name of remote and local branches to assist you in getting started.
So, without further delay Let’s get started!
Branching is a separate line of development that are part of the Git repository. They’re used to segregate your code. Branching allows you to work on different areas of your development project, without needing to alter the development process in general.
What happens if a branch wrongly named? Should you delete it? No. Git isn’t without its problems at times , but it has the ability to change the name of branches.
Git Rename Branch
The branch command in git lets you name the branch. To change the name of a branch, execute git branch –m . “old” is the title of the branch you wish to change as well as “new” will be the name you want to use of the branch.
You can learn more about Git branches in our git rename branch tutorial.