GitHub website: pin a non-master branch on the dashboard - github

We use GitHub for our project and are happy with it.
I often browse the project website to check what my friends are doing on the project, and the dashboard lists the last commits on the master branch of all repositories I contribute to.
This is well and nice, but most of the work happens on other branches then get merged.
Any idea how to pin what happens to these branches on the dashboard?

Beside changing the default branch of a GitHub repo (which isn't what you need), you could also set an RSS feed: see "Setting up an Github Commit RSS feed"
https://github.com/username/repository_name/commits/branch_name.atom?login=login&token=token

Related

GitHub not showing activity?

My GitHub account shows that my latest contribution was on March 21st.
When you head to commits section, you can see that I did commit today and yesterday.
Why isn't it shown in my activity?
Also - for quite a long time I have been commiting to projects from my work-account not realising that it makes me last contributor in my own project :D. Is there a way to link this email (work) with my account?
Check first the "Why are my contributions not showing up on my profile?":
Commits are only counted if they are made in the default branch or the gh-pages branch (for repositories with project sites).
If your commits are in a non-default or non-gh-pages branch and you'd like them to count toward your contributions, you will need to do one of the following:
Open a pull request to have your changes merged into the default branch or the gh-pages branch.
Change the default branch of the repository.
And you were committing on the non-default branch New-Backend-Integration.
Also, the username/email used is important: you can add emails to your GitHub account.

Why is Github not picking up my contributions once I've connected my application to Netlify?

I've deployed an app on Netlify through continuous deployment by linking a single Github repo. I had previously been making commits to the project locally, and my contributions were being tracked for this repo. However, now that I've linked the repo to Netlify, it seems no commits or contributions I make are picked up by Github. The commits can still be seen in the Github repo and commits are updated, but the contributions no longer are tracked despite them working previously.
For some context I've checked the Github help page on contributions:
https://help.github.com/en/github/setting-up-and-managing-your-github-profile/why-are-my-contributions-not-showing-up-on-my-profile
And cannot see what rule I've violated; I'm working on this on my own, it's a standalone repo, etc etc. considering they were being tracked before for the same repo, I'm confused as to what has changed now that Netlify has been integrated.
Any help/guidance appreciated
So it had nothing to do with Netlify, but my work Mac did not have me globally installed as the commit author with my email. After that, all previous authors were wrong as being my local computer email.
To get around this I followed this tutorial to replace all previous commits with the correct author: How do I change the author and committer name/email for multiple commits?

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.

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.

How can I determine the default branch for a github repo from the github web UI?

I want to determine which branch in a repo is the default branch, but I'd like to not have to resort to http requests to do that. Is there someplace in the GitHub web UI that shows the default branch for a repo?
I submitted a support request to github.com asking that they display the name of the default branch in the Web UI, and got a very quick response:
"Thanks for the suggestion. We'll keep this in mind. The default branch is always the branch shown on the main repository page, but I can understand that this isn't necessarily obvious."