Solve problems with gh-pages and the main branch
P粉063039990
P粉063039990 2023-08-10 15:15:19
0
1
436
<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粉063039990
P粉063039990

reply all(1)
P粉482108310

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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!