![]() ![]() âoldâ is the name of the branch you want to rename and ânewâ is the new name for the branch. The git branch command lets you rename a branch. The rename-branch command changes the name of the current branch in the local and origin repository. You can learn more about Git branches in our git branch tutorial. Git may be annoying at times but it does have a method that you can use to rename a branch. Then, locally rename the maintenance branch (2.63-branch) to master: git branch -m 2.63-branch master Now, time to mess with the remote. git branch -m master old-dev Renaming a branch does work while you are on the branch, so there's no need to checkout something else. What happens if a branch is named incorrectly? Do you need to delete it? No. First, in your working tree, locally rename master to something else. ![]() A branch lets you work on different parts of a project without having to affect the main line of development. Without further ado, letâs begin! Git BranchesÄ«ranches are independent lines of development in a Git repository. Step 1 git branch -m oldbranchname newbranchname, Step 2: git push origin :oldbranchname newbranchname. Weâll walk though an example of renaming a local and remote branch to help you get started. In this tutorial, weâre going to talk about how to rename a Git branch.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |