12/18/2023 0 Comments Git rename a branch![]() Conservancy also continues to explore and support other initiatives that can also assist in this area. Git continues their participation, which began four years ago, in Conservancy's Outreachy initiative. Meanwhile, Git as a project remains engaged in encouraging participation of underrepresented groups in the development of Git itself. 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. As always, changes in Git's core will minimize disruption for Git's users and will include appropriate deprecation periods. First, in your working tree, locally rename master to something else. But, you cant directly rename a remote branch its required to push the renamed local. That change is currently being discussed on our mailing list. Renaming a local Git Branch is a matter of running a single command. Also, consistent with its project governance, Git has undertaken a community process to explore changing the name of the first branch created automatically for new repositories away from ‘master’. We support and encourage projects to switch to branch names that are meaningful and inclusive, and we'll be adding features to Git to make it even easier to use a different default for new projects.Īs a first step, Git will add a mechanism to allow users to specify the default used as the name of the first branch when creating a new repository. Thus many projects use it to represent the primary line of development. Offensive to some people and we empathize with those hurt by the use of that term.Įxisting versions of Git are capable of working with any branch name there's nothing special about ‘master’ except that it has historically been the name used for the first branch when creating a new repository from scratch (with the git init command). Many people consider the name main to do a better job of describing this branch and its typical usage.Both Conservancy and the Git project are aware that the initial branch name, ‘master’, is It implies a relationship with some other, unnamed entity, but it doesn’t represent the unique status of the initial branch. ![]() Aside from any offense it may cause, master isn’t a particularly descriptive name anyway. ![]() The Git maintainers have worked with the wider development community to address these concerns. However, the term has become somewhat outdated for its association with colonialism. Other version control systems such as BitKeeper, a predecessor to Git, have also used the term. The master/slave terminology has a long history in computing, especially in reference to hardware such as disk drives. You can see that the branch has been renamed from mistake-fixes to bug-fixes. Step 3: To rename the branch, run git branch -m new-name. The just-created branch can be renamed via this command: git branch -m To switch to a branch, run git switch branch-name or git checkout branch-name. Rename the branch by entering the command: git branch -m new-name Alternatively, you can use a single command. To configure the initial branch name to use in all of your new repositories, which will suppress this warning, call: git config -global faultBranch Names commonly chosen instead of 'master' are 'main', 'trunk' and 'development'. Enter the name of the branch you want to change in your command-line interface: git checkout old-branch You should. This default branch name is subject to change. Using 'master' as the name for the initial branch. Lastly, run this command to list all local and remote Git branches and verify that the renaming was successful: git branch -a. Then, rename the branch by running: git branch -m old-name new-name. Recent versions of Git (2.28 and later) produce the following hint when you create a new repository using git init: Alternatively, you can rename a local branch by running the following commands: git checkout master. Branch Naming and Why Master Is Being Phased Out
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |