Skip to content
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 #849

Closed
simonw opened this issue Jun 15, 2020 · 10 comments
Closed

Rename master branch to main #849

simonw opened this issue Jun 15, 2020 · 10 comments

Comments

@simonw
Copy link
Owner

simonw commented Jun 15, 2020

I was waiting for consensus to form around this (and kind-of hoping for trunk since I like the tree metaphor) and it looks like main is it.

I've seen convincing arguments against trunk too - it indicates that the branch has some special significance like in Subversion (where all branches come from trunk) when it doesn't. So main is better anyway.

@simonw simonw added the ci label Jun 15, 2020
@simonw simonw added this to the Datasette 1.0 milestone Jun 15, 2020
@simonw
Copy link
Owner Author

simonw commented Jun 15, 2020

I'll make this change on a few of my other repos first to make sure I haven't missed any tricky edge-cases.

@simonw
Copy link
Owner Author

simonw commented Jun 15, 2020

I'm doing https://github.com/simonw/datasette-psutil first.

In my local checkout:

git branch -m master main
git push -u origin main

(Thanks, https://www.hanselman.com/blog/EasilyRenameYourGitDefaultBranchFromMasterToMain.aspx)

Then in https://github.com/simonw/datasette-psutil/settings/branches I changed the default branch to main.

Branches

Links to these docs: https://help.github.com/en/github/administering-a-repository/setting-the-default-branch

That worked! https://github.com/simonw/datasette-psutil

One catch, which I think will impact my most widely used repos the most (like datasette) - linking to a specific file now looks like this:

https://github.com/simonw/datasette-psutil/blob/main/datasette_psutil/__init__.py

The old https://github.com/simonw/datasette-psutil/blob/master/datasette_psutil/__init__.py link is presumably frozen in time?

I've definitely got links spread around the web to my "most recent version of this code" that would use the master reference, which would need to be updated to main instead. Most of those are probably in the Datasette docs and on my blog though.

@simonw
Copy link
Owner Author

simonw commented Jun 15, 2020

The big question is how this impacts existing CI configuration. datasette-psutil is configured to use Circle CI, what happens if I push a new commit?

@simonw
Copy link
Owner Author

simonw commented Jun 16, 2020

This guide is fantastic - I'll be following it closely: https://github.com/chancancode/branch-rename/blob/main/README.md - in particular the Action to mirror master and main for a while.

@simonw
Copy link
Owner Author

simonw commented Jun 19, 2020

https://twitter.com/jaffathecake/status/1273983493006077952 concerns what happens to open pull requests - they will automatically close when you remove master unless you repoint them to main first.

@simonw
Copy link
Owner Author

simonw commented Jun 26, 2020

I mentioned this issue here: https://simonwillison.net/2020/Jun/26/weeknotes-plugins-sqlite-generate/

Repositories created by following the REAME in https://github.com/simonw/datasette-template and https://github.com/simonw/click-app have a main branch instead of master so I have a few examples live now. https://github.com/simonw/datasette-saved-queries is one example.

@simonw
Copy link
Owner Author

simonw commented Jul 31, 2020

Watch out for places in the documentation that might link to master - e.g. here:

HTML template and `can be seen here <https://github.com/simonw/datasette/blob/master/datasette/templates/_table.html>`_.

simonw added a commit that referenced this issue Jul 31, 2020
@simonw
Copy link
Owner Author

simonw commented Jul 31, 2020

https://github.com/simonw/datasette/tree/main branch now exists and will automatically mirror master (and vice-versa).

@simonw
Copy link
Owner Author

simonw commented Jul 31, 2020

I'm going to change the default branch on the GitHub repository. If something breaks I can always change it back again.

Done that! Default is now main.

simonw added a commit that referenced this issue Jul 31, 2020
simonw added a commit that referenced this issue Jul 31, 2020
simonw added a commit that referenced this issue Aug 9, 2020
@simonw
Copy link
Owner Author

simonw commented Sep 15, 2020

I've been running on main for a while now with no issues.

@simonw simonw closed this as completed Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant