So, you’ve created a git branch but renamed it incorrectly? This article is for you! You’ve got good luck as Git allows to rename the Git Branch easily just by using the -m code. Let’s learn how to do it?
What is Branch Git?
A branch in Git is simply a lightweight movable pointer to one of these commits.
How to Rename Branch Git?
If you are following my steps carefully then don’t worry you will be able to rename very easily. It just consists of few steps. Follow me:
- Switch to the Git that you want name to be changed.
git checkout <OLD-NAME>
- Rename Branch Git. By using the following command.
git branch -m <NEW-NAME>
3. Delete the Old-name remote branch.
git push origin --delete <OLD-NAME>
4. Insert <NEW-NAME> and reset the up-stream branch.
git push origin -u <NEW-NAME>
Now you’ve successfully renamed the local and remote git branch.
- Namecheap Hosting Review.
- How to install Kali Linux on VMware.
- How to buy parts for Gaming PC in 2019
- Best Web Hosting Providers in 2019
I hope you’ve understood to rename git branch. If you have any queries or suggestions related to this article feel free to contact our team. Contact Us page is for you. But while you are doing anything make sure you follow everything in this article carefully. Thanks for landing on this article. Have a nice day…Ahead.