One option is to set gh-pages as submodule of your own repository.
That means adding thegh-pages
branch content as a subfolder of your current repository, in the master
branch, using git submodule
.
(unless, as explained here, you chose the master
branch itself as source for GitHub Pages)
git checkout master
git submodule add -b gh-pages -- /remote/url/of/your/own/repo gh-pages
git commit -m "Add gh-pages branch as submodule"
git push
You will have a gh-pages
subfolder, that you can update at any time with:
git submodule update --remote
My issue is that I am getting the directory and it's content while I need the content only on the root.
You would generate, from your main repository, the site content not in the directory _site
, but in the directory gh-pages
(which would thereforce have directly the site content).