ElectricRCAircraftGuy / ElectricRCAircraftGuy.github.io

My github pages website at gabrielstaples.com
https://gabrielstaples.com/
5 stars 1 forks source link

rename `master` branch to `main` #66

Closed ElectricRCAircraftGuy closed 1 year ago

ElectricRCAircraftGuy commented 1 year ago

Done. Here's what I did.

git branch -m master main # rename local master to main
git push -u origin main:main # push main to remote, while setting the upstream

# on GitHub, go to settings and change main branch to `main`

git push origin :master  # delete remote master

Done!

ElectricRCAircraftGuy commented 1 year ago

Note that doing this then broke my website, disconnecting it from gabrielstaples.com and www.gabrielstaples.com. I had to go to my domain and re-add my 4 A apex entries for GitHub Pages (see: https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site), as well as go to my repo settings and reattach the github pages site to gabrielstaples.com and to my new main branch.

Next time, try using GitHub's "rename branch" or whatever option in the repo settings, rather than making a new main remote branch and deleting the old master one. Maybe that would break less stuff with my website.

Adding the DNS entries is verifiable with:

# for the C records
dig www.gabrielstaples.com +nostats +nocomments +nocmd
# for the A apex records
dig gabrielstaples.com +nostats +nocomments +nocmd

Both have similar responses with 4 A entries in reply. Only the C record command has a CNAME entry reply as well.