-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename master
branch to main
#5110
Comments
Great point. Yeah, I think @owenvoke, will this result in an impact on any of our GitHub actions or automation? @agnivade: would this have an impact on the tldr-bot at all? |
The only thing I could find on Git is that they are really cautious about renamings of the sort. See: this under Changing the master branch name section. Either way, this section only shows how one should proceed while changing this. I could not find anything about making "main" standard. |
@sbrl @schneiderl See the Git project's official statement and code change. I found that at GH's Blog Post -> Repo. |
Don't think so it's going to cause issues with tldr-bot. |
So, the only required changes for GitHub Actions would be a couple of references to I've created a branch to show the differences that would be required: master...owenvoke:feature/main One thing to note, I think when changing the default branch, we'd have to go through all PRs and make sure that they are pointing at the new one. However, I don't think that should be a problem. On another note, I'm wondering if we should do this for our other repositories? 🤔 The |
@bl-ue, are we sure that there are no issues with this? If so, I'll open my PR in this repository. |
I've changed |
I've renamed the branch in |
I think the For the former 3, developers probably have it checked out with the For the latter, it is of course our main repository, with probably thousands of clones all over the place. We also may have a non-zero number of clients who are hard-coded to checking out the master branch too. |
So what would we do for the clients? Set a date several months in the future, notify all the clients and request that they update to use |
Please set |
@MasterOdin, I'm happy to change this. However, I can't rename it as |
I think the redirect is important. @owenvoke |
@owenvoke I failed to realize that GitHub was offering a rename / redirect service on their settings page. I've gotten rid of the |
@MasterOdin done! 👍🏻 |
Related reading: https://github.com/github/renaming |
In my opinion, the best option for the main repos (tldr-pages/tldr and tldr-pages/tldr.github.io) would be to set a date in the future (e.g. 03/01/21) where main is the new default branch, but keep master around for a couple of years to allow ecosystems to move on (e.g. ubuntu/debian packages, individual clients) and then have a GH action that runs on pushes to Note: Given GH's new rename system for branches, renaming the default branch will automatically update PRs so it should be fairly painless for in-progress PRs from external collaborators. |
Sounds like a plan, @MasterOdin! The 3rd January 2021 has already passed though, so I'd suggest something like 1st April 2021 or something. |
@sbrl I think he means March 1st, maybe we're getting American vs. European date formats mixed up? |
Yup, I meant March 1st, 2021. |
Oh, I see. Yeah, we could do that. It doesn't give too much time to update the GitHub actions automation etc, so I'd suggest we have a PR ready to merge at the time before committing to a date. |
Perhaps a better notion would be to make a PR to set it up so that pushes to |
That's a cool idea too, @MasterOdin! @owenvoke, is that feasible with GitHub Actions at all? |
Yes, it should be, and should be as simple as doing:
given that it's a |
We could always use this action as well. 🤷🏻 https://github.com/marketplace/actions/mirror-branch |
master
branch to main
We could even start the ball rolling here by creating the new |
Agreed. I think we could do that now, with the proposed GH action going to pick up any intermediately made commits before the workflow gets added. |
Would we be changing the default branch to |
I don't really see why we can't switch the default branch to |
I think it's a "let's make sure this works as we expect" deal so that we don't just switch over and potentially break a bunch of clients. |
Yeah. The idea is that we first start with Then, we can flip it over to have Finally, we delete the Though all existing PRs would have to be reopened when we flip from one to the other.... |
What do you mean by that? Do you mean 'existing, open PRs'? |
@sbrl, when changing branch through the UI it automatically changes the PR base branch. 👍🏻 Or at least it does when you specify a branch rename. |
The mirroring is working well. It takes ~20 seconds for commits pushed to master to be mirror-pushed to main. The next thing to do would be to switch them over. That shouldn't cause problems for clients because the two branches are almost always indentical. When should we set the date? April 1st? |
Need to also set-up a similar thing for https://github.com/tldr-pages/tldr-pages.github.io for people grabbing the zip through the githubrawcontent link. Will do that tomorrow. |
@MasterOdin did you ever get back to this? |
In terms of setting a date for the flip over, @owenvoke suggests the 1st of May:
Source: https://gitter.im/tldr-pages/tldr?at=607c280bb6a4714a29d0bd95 This sounds good to me too. Steps that need to be performed:
|
The rename for Please watch out for new PRs that merge against Note that the GitHub action did not create |
Nice! Thank you all for the effort. |
According to our Inclusive Language section on the Contributing Guide, we should always try to use inclusive language.
According to the Guide,
I believe that if that is in our Contributing Guide, we should follow it in our main repositories at least. That includes how we name our branches.
Our "main" branches are still named "master" in all the repositories from the organization.
Should we think of renaming this?
Also, if we do rename, I would suggest "main" instead of "primary" following what is being done by GitHub.
The text was updated successfully, but these errors were encountered: