Can I publish multiple branches of a repository on GitHub Pages? #21582
-
I have already published the master branch of my repo on Github Pages. Can I somehow publish another branch of the same repository so the the url is something like: username.github.io/repositoryname/branch ? Or will I have to create another repository instead of a branch to publish it? |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments 4 replies
-
Hi @ankitasood!
GitHub Pages only lets you configure one publishing source for a particular repository. So in this particular case, you’ll need to create a new repository and add the content you’d like to publish with GitHub Pages to that newly created repository. Does that answer your question? Please let me know if I misunderstood you or you have additional questions. |
Beta Was this translation helpful? Give feedback.
-
Hi there! It’s a pity it works that way. In my case, I am maintaining an open source project hosted on GitHub. The project has several major versions (few of them still supported and maintained separately on different branches of the repo). It would be very nice if I could have the documentation of each of those versions/branches published separately. Best, Thomas |
Beta Was this translation helpful? Give feedback.
-
Exactly, also it’s doesn’t help when working on documentation because you can’t preview what will be build on the github doc site until it’s merged into master… What I’d prefer, is to automatically build one doc site for each branch that have a docs/ folder, and use either subdomains or a different domain for docs generated from branches that aren’t the default branch (usually “master”) Example: https://unlyed.github.io/next-right-now/ (“master” branch) https://unlyed-docs.github.io/next-right-now/ (“docs” branch) https://docs.unlyed.github.io/next-right-now/ (“docs” branch) I think the latest looks the cleanest. It could be done either automatically for all branches, or through a pattern ( This would be much more usable. |
Beta Was this translation helpful? Give feedback.
-
I’m using github pages for my master branch but netlify for the dev branch, as they allow hosting for seperate branches. |
Beta Was this translation helpful? Give feedback.
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
@ankitasood thank you for the question and @nickcannariato thank you for the answer |
Beta Was this translation helpful? Give feedback.
-
Maybe this help: |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
Thanks so much 👍
I appreciate your response. This helps.
…On Wed, 17 Jan 2024, 17:48 Yuhesh Pandian P J, ***@***.***> wrote:
There could be several reasons for CSS not reflecting on your deployed
site. Check if the CSS file paths are correct, clear browser cache, and
ensure there are no errors in the CSS code. If the issue persists, inspect
the browser's console for error messages, which can help pinpoint the
problem.
—
Reply to this email directly, view it on GitHub
<#21582 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BEVSFUZUI2Y3YLRZHIUGVVDYO76GJAVCNFSM6AAAAAA6ITD3ACVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DCNJZGMZDO>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Based on the above answer, I adopted the approach of committing multiple branches to files in my other repository, and then deploying them all together to GitHub Pages from that repository. This way, I can access the content of the main branch in /main, the content of the dev branch in /dev, and deploy an index page in the root directory. 基于上面的回答,我采用了将多个分支commit到我的另一个仓库的文件下,然后在另一个仓库全部一起部署到github pages上的方式,这样就可以在那个仓库的/main里面取到main分支的内容,/dev取到dev分支的内容。根目录可以部署一个索引页。 非常感谢上面的回答!解决了我的问题~ |
Beta Was this translation helpful? Give feedback.
Hi @ankitasood!
GitHub Pages only lets you configure one publishing source for a particular repository. So in this particular case, you’ll need to create a new repository and add the content you’d like to publish with GitHub Pages to that newly created repository.
Does that answer your question? Please let me know if I misunderstood you or you have additional questions.