This is effectively a duplicate of How to merge main and master branches? My answer there, however, is much longer and more general: it covers your specific case, but your specific case is quite simple as you have nothing interesting on your GitHub main
. You can just replace your existing GitHub main
with what you currently call master
, using:
git branch -m main
git push --force origin main
from your computer (your laptop). Normally, git push --force
(or even git push --force-with-lease
) is something to use carefully at best. Here, you're using it carefully—though you may not yet know it.
I recommend you read through the more complete answer here, but given the two images you show in your original question, the "overwrite main" method shown above should suffice.