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

Change the default for github_branch #439

Closed
lz100 opened this issue Feb 1, 2021 · 11 comments
Closed

Change the default for github_branch #439

lz100 opened this issue Feb 1, 2021 · 11 comments
Milestone

Comments

@lz100
Copy link

lz100 commented Feb 1, 2021

Since Github has changed the default branch from master to main. The Edit this page button uses the github_branch config to create the page and the default is "master". Should we consider changing it to "main"?

@lz100 lz100 changed the title Edit this page button is not working with new Github Change the default for github_branch Feb 1, 2021
@LisaFC
Copy link
Collaborator

LisaFC commented Feb 2, 2021

Has it changed across the board, as my URLs (eg for this repo) still have master in them?

@gwatts
Copy link
Contributor

gwatts commented Feb 2, 2021

Github aren't going to force or auto-change existing repos from master to main as that would be hugely disruptive for many projects; they've just made it the default for new projects. See their docs on how to rename the branch

So the problem then is, if we change the default if page-meta-links.html it will break all existing deployments that have not explicitly configured github_branch in their site's config.toml

Probably a good idea to update the config.toml in the template examples sites to default to main now though; i did that for my mostlydocs one already

@LisaFC
Copy link
Collaborator

LisaFC commented Feb 2, 2021

Gotcha. I can change the default in the config and maybe add a note to the relevant docs that you should check the value for your own repo.

@LisaFC
Copy link
Collaborator

LisaFC commented Feb 2, 2021

Hrmm. Actually I'd need to rename the master/main branch in the example sites as well if I changed it in the example's config.toml, because if you clone it/use it as a template you get the same branch names - just need to check what else I'd need to update (eg Netlify config) to go with that to avoid breaking stuff....

@laszewsk
Copy link

laszewsk commented Feb 4, 2021

Yes I just tried out and master on the example site does no longer work at all. You provided my favorite theme. What do we have to do to use it right now? Or do you have an anticipated time when a fix is available?

@LisaFC
Copy link
Collaborator

LisaFC commented Feb 5, 2021

Yes I just tried out and master on the example site does no longer work at all. You provided my favorite theme. What do we have to do to use it right now? Or do you have an anticipated time when a fix is available?

That's strange, it shouldn't break anything for existing sites (including our example site) - as @gwatts said above, the new default branch name in GitHub is only for new projects. If you have a Github repo where that branch is "main" rather than "master" and you want your GitHub links to work, you can change the github_branch value in your config.toml as described here:

https://www.docsy.dev/docs/adding-content/repository-links/#github_branch-optional

@laszewsk
Copy link

laszewsk commented Feb 5, 2021

great. I overlooked the github branch value that can be set. with that, we are back in business ...

@laszewsk
Copy link

laszewsk commented Feb 9, 2021

Please add

# The new default in github is main, we also recommend that you rename the branch master to main
# github_branch = "main"

to config.toml at around line 114

I had previously created a pull request, but because it was not proceeded by a comment # it failed.

This woudl be helpful for those that are waiting for a proper fix

@LisaFC
Copy link
Collaborator

LisaFC commented Feb 10, 2021

Like this? google/docsy-example#106

I'm not sure we can/should make them change the branch name as they may have other eg continuous deployment tooling pointing at "master", but I can put more detailed info in the docs including linking to the GitHub doc on the subject and their recommendations.

@laszewsk
Copy link

Yes the comment in the toml would be sufficient in addition to maybe adding it more prominently in the makefile.
In any case any time you do use this as a template, you need to rename the branch from master to main and than outcomment the line in the toml file

@chalin chalin added this to the 22Q1 milestone Mar 5, 2022
@chalin
Copy link
Collaborator

chalin commented Apr 4, 2022

Closed by @deining in #916

@chalin chalin closed this as completed Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants