How to Rename Branch Name in Git Command?
This article is focused on how to rename branch name in git command. I explained simply about how to change branch name in git command. if you have question about git command to change branch name then I will give simple example with solution. This article will give you simple example of git rename branch command line. follow bellow step for git command rename branch.
In this tutorial, we will use git branch command rename branch in github repository. we will use git command to change branch name into github. so let's follow below step to rename branch in git.
Clone Git Repository(Optional):
If you are new and you haven't create or clone github repository yet then you can follow bellow tutorial:
Github Create or Clone Git Repository.
Rename Branch using Git Command:
First i will show you "git branch" command to check which branch currently active, then you can change branch name. let's run below command:
git branch
Now, we will change branch name "dev" to "dev-change" branch, let's see bellow command:
Syntax:
git branch -m <new-name>
Example:
git branch -m dev-change
You can see below layout:
Let's see created new branch in Github Repository List:
I hope it can help you...
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- How to Create a New Branch on GitHub?
- How to Clone Github Repository using Command Line?
- How to Ignore Wildcard Files Name in Git using Gitignore?
- How to Ignore Folder in Git using Gitignore?
- How to Ignore File in Git using Gitignore?
- How to Git Ignore Some Files Locally?
- How to Clone a Git Repository into a Specific Folder?
- How to Clone Laravel Project from Github on Server?
- How to Add Git Add Remote Origin on Bitbucket Repository?
- Git - How to Find a Deleted File in Commit History?
- How to Configure Git Username and Email?
- How to Git Force Pull from Remote Branch?