Better support GithHub's user/org pages.
See original GitHub issueIn addition to supporting project pages (which use the gh-pages branch of the same repo: username/projectname
), GitHub also supports user/organization pages which use a separate repo at username/username.github.io
which then is published at https://username.github.io
(rather than https://username.github.io/projectname
). The problem arises from the fact that user/org pages use the master
branch, which requires the repo which holds the built pages to be different than the repo that ghp-import needs to publish to.
Consider the following pseudo workflow:
cd project
build_docs --docs docs/ --out site
At this point, I am in the project repo, not the pages repo. If I do an ghp-import
call, I will be pushing to the wrong repo. So I tried setting up an extra remote:
git remote add pages https://github.com/username/username.github.io.git
Then if I run:
ghp-import -r pages -b master site
It pushes the contents of the site
dir to the master branch of the pages
repo and my site gets published. However, in the process it also skunks my project repo by adding the same commit to the master
branch of the local repo.
Perhaps if there was an option to specify a local branch to use, that would resolve the issue:
ghp-import -r pages -b master --local-branch foo site
Then the commit would be committed to the foo
branch (or whatever I choose to call it), which would then get pushed to the master
branch of the pages
remote.
I realize that a workaround exists today, by changing to the pages branch and then calling ghp-import
, but I’d rather not have to do this:
cd ../pages-repo
ghp-import -r origin -b master ../project/site
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Don’t take that the wrong way. It may be possible with some config settings. My only point there was that if that is the sort of required setup I’d make it a README entry vs supporting it directly in code. I just haven’t had to ever investigate that particular aspect to know. If you do google around and find something let me know and we can figure out how best to approach it.
I’ll leave this ticket open for awhile incase someone else has something similar and/or knows the proper incantations for making that happen.
Resolving this issue as it’s been 3 years. Feel free to reopen if this is still a concern for you @waylan.