'Solution to Keep gh-pages up to day with a master/main branch
I recently build a gh-pages using React and found that my changes in the main branches would not be synced with gh-pages.
Then I found that I don't need to push the whole updates to gh-pages and even to master/main branch for updating my site. In order to see updates on my git page, I ran npm run deploy using Vscode on the main branch then just wait for a few minutes to see updates on my gh-pages."
Simple Solution: enter npm run deploy on the master/main branch then wait a few minutes to see updates showing on your gh-pages and your site on github pages
Below is a suggested solution but it's not working for me.
`$ git add .`
$ git status // to see what changes are going to be commited
$ git commit -m 'Some descriptive commit message'
$ git push origin master
$ git checkout gh-pages // go to the gh-pages branch
$ git rebase master // bring gh-pages up to date with master
$ git push origin gh-pages // commit the changes
$ git checkout master // return to the master branch
Hope this post can help. Thank you.
Resolve the syncing issue between gh-pages and master/main branch in GitHub. This issue refers to the updates made in master/main branch are not synced to gh-pages.
Solution 1:[1]
Simple Solution: enter npm run deploy on the master/main branch then wait a few minutes to see updates showing on your gh-pages and your site on github pages
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Tri Nguyen |
