ebpf.io-website icon indicating copy to clipboard operation
ebpf.io-website copied to clipboard

Rename `master` branch to `main`

Open qmonnet opened this issue 2 years ago • 7 comments

It's 2023 and it's usually a good practice to drop the name master in favour of something like main for the principal branch of the repository. Most repos I work with have done the switch (or are recent enough to be using main since their creation). Let's make this repo more user-friendly.

Technically I have the permissions to do this myself on the repo, but it requires a bit of sync between the different contributors, and probably some sync with whatever workflow runs on Netlify, so I really prefer to open an issue here instead.

qmonnet avatar Nov 07 '23 16:11 qmonnet

@xmulligan we fully support the initiative to rename the principal branch to 'main' in line with current best practices. However, we currently do not have the necessary access rights to the repository settings to make this change.

If you could grant us the required access, we'd be happy to handle the renaming process. Alternatively, we can prepare everything on our side, and once we're set, you can switch the default branch to 'main'.

Please let us know how you'd prefer to proceed.

americano98 avatar Nov 13 '23 12:11 americano98

Sure, what access do you need?

xmulligan avatar Nov 13 '23 18:11 xmulligan

Hey @xmulligan , we require Admin level access to be able to mess with repository settings and I doubt that's reasonable to ask at all.

Here is what I suggest:

  1. Here is the mirror to master branch called main
  2. You, or anyone with admin access follow this instruction and change default branch to main
  3. We update the target branch on Netlify and call it a day

⚠️ Of course, there is this caveat that existing PRs need to be retargeted afterwards, but that's not a big deal.

Wdyt?

bolotskydev avatar Nov 14 '23 10:11 bolotskydev

Happy to apply step 2 whenever you're ready. Let's schedule a day and time so you can take a look immediately after the switch to update Netlify and ensure everything is still working? We could say tomorrow morning for example (I'm on UTC+00:00). Or later if you have another preference, just let me know.


As for the specific action for step 2: I think you linked to the wrong doc, the one you have is for setting the default name for the main branch on new repositories. Here we have two options:

  1. Either switch from master to main that you have created, following these steps
  2. Or rename master into main, following these steps instead. This option has the advantage to automatically update the existing pull requests:

    Branch protection policies are also updated, as well as the base branch for open pull requests (including those for forks) and draft releases.

I'd prefer option 2 to avoid breaking the existing PRs etc., however, this may conflict with the existing main branch that you have created. So here is what I plan to do, if you agree:

  • Creating another copy of master and main, say master-legacy
  • Then deleting the current main
  • Then renaming master into main, thus updating the open PRs

Let me know if this process sounds good to you, and let's confirm a time slot for the change.

qmonnet avatar Nov 21 '23 10:11 qmonnet

How about planning this for next Monday? @bolotskydev

qmonnet avatar Nov 29 '23 17:11 qmonnet

@bolotskydev or @americano98 can you still help with this?

xmulligan avatar Mar 15 '24 11:03 xmulligan

@americano98 @bolotskydev any update here?

xmulligan avatar Jun 27 '24 08:06 xmulligan

@americano98 @bolotskydev this is supposed to be quick, could any of you help please?

qmonnet avatar Jul 19 '24 14:07 qmonnet

Hi @qmonnet, we have deleted the old main branch and added master-legacy as per your guide above. We do not have the rights to rename the master branch. Could you please rename master to main and contact us? We will then check that everything works correctly on Netlify and make any necessary adjustments

americano98 avatar Jul 23 '24 14:07 americano98

Hi @americano98, thanks a lot! I just renamed the branch, so you can check on your side now. :tada:

qmonnet avatar Jul 23 '24 14:07 qmonnet

@qmonnet, thank you for your help and attention. We have updated the configuration, and now previews are built from the main branch🎉

americano98 avatar Jul 23 '24 15:07 americano98

Great to hear, thanks again!

qmonnet avatar Jul 23 '24 15:07 qmonnet