Remove the existing tracking connection with "origin/master".Get the latest commits (and branches!) from the remote by performing a "Fetch".Here's an overview of what they have to do: If other people on your team have local clones of the repository, they will also have to perform some steps on their end. If you try again now, deleting "master" from the remote repository should be successful! What Your Teammates Have to Do You will then be able to delete the old "master" branch on the remote.Īs an example, here's how to do this in GitHub: GitHub and Gitlab), you have to change the "default" branch or remove any "protected" status for "master". You can simply try right-clicking that branch in the sidebar and choose the "Delete." option from the contextual menu.Ĭhances are, however, that you will be presented with an error message! The reason for this is that in many Git hosting platforms (e.g. What's left is to delete the old "master" branch on the remote repository. Step 3: Delete the Old "master" Branch on the Remote You can do so by dragging it in the sidebar and dropping it onto the remote (e.g. Step 2: Push the Renamed Local Branch to the RemoteĪs a second step, you need to publish your new (or, more appropriately: renamed) "main" branch on your remote repository. You can do that simply by right-clicking the branch in the sidebar and then choosing the "Rename." option from the contextual menu. Step 1: Rename Your Local Branchįirst of all, you should rename your local "master" branch to "main". This short article will help you rename "master" in your own Git repositories to "main" (or any other term your team has chosen). But the most popular term seems to be "main". In the public discussion, a handful of different alternatives for "master" have popped up, "default" and "primary" being some of them. Fortunately, many people have become aware that this terminology (even more evident in "master/slave") should be replaced! The tech industry should move to a more inclusive, open culture - and removing language like "master/slave" is an important step in this journey. For the longest time, the default branch in most Git repositories was named "master".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |