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:
Now, we will change branch name "dev" to "dev-change" branch, let's see bellow command:
git branch -m <new-name>
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...
We are Recommending you
- Github - How to Create New Branch using Git Command?
- 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 ?
- How to find deleted file in git repo history log?
- How to set git config username and email?
- How to Git Force Pull from Remote Branch?