search

Home  >  Q&A  >  body text

Solve problems with gh-pages and the main branch

<p>I'm having some issues with my personal portfolio. Initially, I created my portfolio using github pages and got a custom domain name, and everything went smoothly with deployment. Recently, I decided to make some drastic changes, which I made on my deployment server in another folder. When I was ready to push everything, I just deleted the content in the initial folder (don't worry, I had a backup) and pasted in my updated content. After I push the content to the main branch, if I try to run the website from the main branch, it only shows the readme. However, if I try to run the site from the gh-pages branch, it shows the old content, unedited. How should I push my changes to the gh-pages branch? </p>
P粉063039990P粉063039990560 days ago518

reply all(1)I'll reply

  • P粉482108310

    P粉4821083102023-08-11 09:49:35

    To push your changes to the gh-pages branch, you can follow these steps:

    Clear local cache:

    git rm -rf .git
    
    git init

    Switch to the gh-pages branch:

    git checkout gh-pages

    Add all changed files:

    git add .

    Submit your changes:

    git commit -m "部署了新的更改"

    Push changes to GitHub:

    git push origin gh-pages

    reply
    0
  • Cancelreply