![]() ![]() This article showed you how you can rename a local Git branch, especially if it’s the current branch. To confirm that, you can run git branch again: ![]() You can see the name of the branch has been successfully changed to bug fixes. m in this situation is a flag that stands for move. Remember I pointed out that I want to rename the fix bug branch to bug-fixes, so I’ll run git branch -m bug-fixes. To rename the branch, you need to run the command git branch -m new-name. You can see that git bash shows me the branch I’m currently in now, which is fix bug. In this case, I want to change the fix-bug branch to bug-fixes. You can do that by running git checkout branch-name. Next, make sure you are in the branch you want to change the name of. The first thing you need to do is to run git branch so you can see the branches you have in place: Proceed to the next section of this article to see how you can rename the current branch in Git. To rename a branch you are not currently working in, you usually run the command git branch -m old-name new-name.įor example, I’m currently on the main branch and I was able to rename kolade-works to kolade-codes. Git rename branch how to#In this article, I will show you how to rename the branch you’re working with without switching to another branch. Since you have those branches in place, you might want to rename any of them if you find a typo, for example, or change the code's purpose. If you are using Git for version control, it’s likely you’ve created branches for various reasons. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |