![]() ![]() Now you need to set “main” as the default branch for your project on GitHub. Git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main Push the newly-named main branch to GitHub (assuming that is your remote repository) with the command: Move the master branch to main with the command: I’ll show you what steps to take in a very generic sense (make sure you’re working with the project in question).īefore you do anything, back up all of your work–you do not want to wind up losing your data from a branch rename–though you should always back up your work. ![]() How to migrate the default branch of your GitHub projects from master to mainĪs GitHub does its thing, the most important steps you can take is migrate the default branch of all your projects from “master” to “main” if you don’t, you’ll be dependent on the tools GitHub creates to make this happen automatically. Given that the whole of global enterprise depends on the Linux kernel, such an event could be disastrous, so GitHub doing this right is crucial. One poorly planned move, and projects like the Linux kernel could find their code unreachable. You might think all of these changes should be a no-brainer and painless, but with over 40 million users, more than 100 million repositories, and at least 28 million of those repositories being public, this is a massive undertaking. GitHub is also hoping to be able to redirect users who use either git fetch or git clone to move an old branch name to a new branch name. That means when you rename a branch, GitHub will automatically retarget open pull requests and draft releases and move your branch protection policies. GitHub’s intention is to ensure that, by the end of the year, all repositories will be able to seamlessly rename their default branch. Open pull requests must be targeted to the newly named branch ĭraft releases must be targeted to the newly named branch andīranch protection policies must be transferred to the newly named branch. This comes with a particular set of challenges, including: Users, organizations, and enterprises can opt out of this change at the following locations:īy the end of the year, all existing repositories will be migrated to the new naming convention. On Octonewly created repositories will default to “main.” Existing repositories will have the same default branch they currently have, and the change will not impact your existing repositories. GitHub has added user, organization, and enterprise settings so developers can set the default branch name for all newly created repositories. GitHub pages have been updated to deploy from any branch. links that contain the deleted branch name “master” are already redirecting to “main.” Other than the change in terminology, how will this directly impact you? Let’s take a look.įirst, GitHub has already implemented the following changes: SEE: Implementing DevOps: A guide for IT pros (free PDF) (TechRepublic) What developers need to know about this GitHub change That means change is going to be global and project-wide. GitHub is used by millions of developers, some of them working alone, but many of them working together. I would expect a lot of other technologies to follow this example, so devs will more than likely be, at some point, making similar changes to a number of the tools they use. Now, you’re going to have to shift to git checkout main. Even if you know the change is the right thing to do (spoiler alert: it is), your fingers have been typing git checkout master for years. Starting Octoall “master branches” will be called “main branches.”įor developers who have been knee-deep in Git and GitHub for years, this change will take some time to get used to. This change across the tech landscape should have occurred long ago, but at least it’s finally happening. Learn with two years of DevGuides online webinars for $39ĪWS re:Invent 2022: A tiered tour of technology tools, tenets and trends How to find and install the new Windows 11 22H2 update This time, it’s GitHub and the new nomenclature will shift from “master” to “main.” The reason for this change should be obvious, but for those that aren’t sure, it’s to rid the company of any holdover references to slavery and replace them with terms of inclusion that cannot be misconstrued. ![]() With GitHub stripping out divisive terminology, what will developers need to know to make sure this transition is seamless?įrom the office of “long overdue,” another service is dropping the divisive “master” terminology from its technology. ![]() GitHub to replace master with main starting in October: What developers need to do now ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |