Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Add note about GH Pages redeploy #16

Merged
merged 2 commits into from Feb 11, 2022
Merged

Conversation

TheJaredWilcurt
Copy link
Contributor

@TheJaredWilcurt TheJaredWilcurt commented Apr 28, 2021

I changed master to main on a username.github.io repo and the site went to 404. I assumed it was DNS related and would solve itself and went to sleep (using a CNAME file). The site was still down in the morning, so I edited the index.html to add a single character change and merged to trigger a deploy. This fixed it.

I'm shocked that GitHub doesn't just perform a one-time deploy of GH Pages after a branch rename. Especially in a scenario where you're going from master to main on a repo ending in .github.io. But really it should just do that anytime the branch used for GH Pages is renamed. Forcing all users to know about this weird edge case and having to add a space to a file to fix it is very hacky.

Until this can be automated by GitHub staff, it should at least be documented.

I changed `master` to `main` on a `username.github.io` repo and the site went to 404. I assume it was DNS related and would solve itself and went to sleep. The site was still down in the morning, so I edited the `index.html` to add a single character change and merged to trigger a deploy. This fixed it. I'm shocked that GitHub doesn't just perform a one-time deploy of GH Pages after a branch name. Especially in a scenario where you're going from `master` to `main` on a repo ending in `.github.io`. But really it should just do that anytime the branch used for GH Pages is renamed.
@infin8x
Copy link
Contributor

infin8x commented Apr 29, 2021

@willsmythe can you comment on this?

@TheJaredWilcurt
Copy link
Contributor Author

There is now a note added to the alert when you go to rename your branch. Though this is pretty easily missed and it would still be useful to have this documented for those after the fact.

screenshot

@TheJaredWilcurt
Copy link
Contributor Author

Fun fact! I just changed that branch from master to main 2 days ago, took a screenshot specifically for this issue and then TOTALLY FORGOT to "make a commit adding a single space" to cause a redeploy. So my portfolio site has been down for the last two days.

@michaelmior
Copy link

Instead of adding a single space (or some other meaningless) for this, you can just use the --allow-empty to git commit to allow an empty commit which when pushed will also trigger a redeploy. When I'm the only one working on a project, sometimes I'll also use git commit --amend which rewrites the last commit, but only changes the timestamp and then force push this.

README.md Outdated Show resolved Hide resolved
@willsmythe willsmythe merged commit b450893 into github:main Feb 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
9 participants