gh-pages across Github projects all link to domain - github

I'm using GitHub Pages and Jekyll on my repository and have linked the repository to my own URL.
So, rimager.github.io links to rimagerhard.com
When I create a new repo and push to the gh-pages branch, that repo becomes available under my URL as well. For instance, I pushed to my literary-quotes gh-pages branch and poof, it's all up under http://www.rimagerhard.com/literary-quotes/
Could someone explain to me why this is happening? I am feeling a bit obtuse today. Thanks :)

Once you set a custom domain on Github, it sets a permanent redirect from rimager.github.io to rimagerhard.com.
As rimager.github.io/literary-quotes is considered as part of the domain, the redirection applies.

Related

Some confusion about the traffic of github repo?

As the pictures show below, the git clones of my repo is 26, and the visitor of my repo is 4. According to the literal meaning, the cloners means who look my repo page and decide to clone my repo to local or somewhere, and also, in the meantime, they should become the visitors of my repo. However, the traffic data of my repo shows that the results of visitors and cloners are much different from each other.
My insight of visitor and coloner is right? What is the GitHub official definition of the cloners and visitors? Or, the significant difference that shows on my picture just caused by the bug of GitHub.
The command git clone http://url will clone the repo without visiting GitHub. Maybe your repo's name is an easy misspelling of another repo, or someone attempted to download all repos by cloning from a list of URLs, looking for loose passwords or doing statistical research.
It could be cloned by you from another IP (other home/TOR/VPN) or you told someone about the repo and someone cloned it without visiting the page.
Do you have a CI/CD server or a DevOps pipeline?
These will clone your repo automatically when triggered by a commit or
a pull request.

GitHub Pages publishing from master vs master/docs or gh-pages branch

I've been able to publish GitHub sites under my domain on GitHub Pages from the master branch without issue, however in the docs it says to use a gh-pages branch or master/docs for publishing projects.
I also have a repository for my homepage index.html file/assets, where I link to each of the published GitHub repositories (which are published to my domain name.com/repo-name).
Why have I been able to publish from the master branch? Is there any reason to publish from the gh-pages branch or master/docs instead for publishing project repositories?
GitHub Pages can publish from any of those sources: gh-pages branch, master/docs, or just from the repo itself. It's more of a preference which route you use.
For example, Jekyll is publishing using the master/docs option. The rest of the repo outside of the docs folder is for the actual Jekyll code. One possible reason is that PR's with new features must also include documentation of that new feature. Otherwise, it won't get merged.
The gh-pages option means that code and documentation can be paced or managed differently. They live in the same repo, but the branches can grow at differing speeds.
In terms of technical differences, there's no technical costs/benefits to each option as far as I know. It's just how you want to organize your code and documentation.
Hope that helps!
GitHub requires user and organization sites to build from master, while project sites can build from gh-pages. If I understand correctly, you are publishing to your user site, i.e. yourusername.github.io.

My GitHub repository is updated but my published GitHub page won't update. Why is this?

Similar questions have been asked but I haven't been able to find my answer:
My site is fine locally and all the correct files seem to be on my GitHub, but my published site (https://username.github.io/project) is still only showing my first intitial push.
Can someone direct me to troubleshoot?
From "Configuring a publishing source for GitHub Pages"
make sure you have enabled GitHub Pages to publish your site from master or gh-pages
or that you are one a master branch, subfolder docs.
Then you might need to wait a minute or two before seeing those pages rendered.

github site from gh-pages branch

I have GitHub site like example.github.io and want to load this site from the gh-pages branch!
how can I do?
now I can't change branch because my repository name is example.github.io
When you create yourusername.github.io you have to commit directly to master. It's meant as a website (unlike a repo that has a website that hosts to yourusername.github.io/reponame/*.
Since you already have a branch with the website, just merge it into the master branch. This can be done from the command line, the Github website or Github Desktop.
The logic
Example: You have a repo (username.github.io). You also have two repos set up with Github pages: repo-1 and repo-2.
username.github.io is the root. You're free to do pretty much anything you want with it. Creating directories will be relative to the root of the domain. When you connect to the domain, it finds the files from the master branch. If you go into the repo settings for username.github.io, you'll see this:
You're locked to the master branch. You can still use other branches for adding features, but what the actual website consists of is what's on the master branch.
The difference between the username.github.io repo and repo-1 or repo-2 is that username.github.io allows editing access to the directory root (e.g. http(s)://username.github.io/index.html) where as repo-1 and its connected pages would be at http(s)://username.github.io/reponame/index. Since the website is most likely wanted to stay out of the source itself, you can use an alternate branch to host it.
If you go into settings for repo-1 or repo-2, you'll see this:
Here you can pick. If you have multiple branches, you can select a different one to host the pages. You can also select the option to use the /docs folder for the website.
TL:DR; When using username.github.io, the master branch is the one that actually hosts the website. Think of it as the production branch. The others can't be accessed from the website
From the OP's comment:
So I can't use the gh-pages branch for Github site! yes?
Update Sept. 2020: yes, you now can.
You can use any branch you want.
"Build and deploy GitHub Pages from any branch"
Repositories that use GitHub Pages can now build and deploy from any branch.
Publishing to the special gh-pages branch will still work the same as it always has, but you can now choose a different branch in your repository as the publishing source.
This functionality also removes the hardcoded dependency on user and organization pages having a master branch.

jekyll website not updating on github pages

I recently played around with the Jekyll/Poole/Lanyon theme for a new blog. At first, I linked my domain jonathancharleslee.com to my github pages site at jonathancharleslee.github.io
When I update files locally, I can update site features and posts - however, when I push to github it won't update on jonathancharleslee.github.io
Any help is much appreciated.
You're on a user/organisation repository (username.github.io). This type of repository needs you to push in master branch, not in gh-pages.
See Github Pages doc
You should be working and making all your changes on the development branch, then pushing ONLY your built files to the master branch, which is what Github Pages will publish.
There's step-by-step instructions on how to do this in this posting:
https://stackoverflow.com/a/44296933/7669275