Feel free to skip the optional steps if they do not apply to your situation. I will walk through this migration, step-by-step. Branch protection policies need to be transferred to the new branchĭon’t want to wait? While this won’t be as simple as just renaming your branches, you can still perform this switch on your personal or organization’s repos by modifying branch protections, PRs, and draft releases.Draft releases need to be retargeted to the new branch. ![]() Open pull requests need to be retargeted to the new branch.In Github’s official statement, they suggest waiting until later in the year to perform this switch yourself if your repo has any of the following conditions: Can’t I just rename master to main? □Īutomation and development workflows will make renaming master require more effort than just following the first Stack Overflow answer you can find to answer the question. As a result, hosting platforms such as Github or continuous integration systems like Jenkins or TravisCI create workflows that typically use these defaults as release branches. But did you know that Git (the tool) has no technical requirement that you use master as your default branch name? However, because it is the first branch created when you run git init, it’s often the default used. The usage of master is unfortunately deeply ingrained into those who learned how to use git and developed muscle memory. Instead, the name main will be used from now on. Starting October 1st, 2020, Github will officially stop their practice of naming the first branch of new repositories master. If you have existing git repos at Github (or any other git hosting platform), you probably have a branch in your repo named master. Introduction □ What’s in a (branch) name? □ ![]() Follow this simple checklist to confidently make these changes and create a seamless experience for yourself and your developer community. Want to migrate your git branches from master to main? Your branch protections, in-progress PRs, and drafts can migrate safely. 9 steps to rename your default Github branch safely
0 Comments
Leave a Reply. |