Find all user commits in a github repo - github

A github repository can have commits by many users.
How can I find all commits made by a user in a github repository in browser?
Let's say
when i say https://github.com/navyad/messengerbot in browser, it shows page of that repo.
How same url can be used to figure out the commits of a user?

If following is the repo url:
https://github.com/xyz/repo/
and you want all commits from master of user nayad
then
https://github.com/xyz/repo/commits/master?author=navyad

Related

Get the user who created a branch with GitHub API

Background
I am using GitHub Enterprise.
I want to check unused branches in my repository, and ask owners of these unused branches to clean-up.
You can see "Your branches" (branches created by current user) on “Branches” page in GitHub. So I think GitHub might have information for who created a branch.
On the other hand, the result of GitHub REST API (https://developer.github.com/v3/git/refs/#get-a-reference) does not contain the creator of the specified branch.
Question
Is there’s any way to get the user who created a branch with GitHub API?
There is no real "ownership" associated to a branch with Git/GitHub.
As mentioned in the documentation, "Your branches" reference in a repository the branches you have push access to, not necessarily the ones you have "created".
The best you can do is, if you have access to a local clone, a simple git fetch, followed by:
git for-each-ref --format="%(committerdate) %09 %(refname:short) %09 %(authorname)" --sort=-committerdate refs/remotes/origin
That will list the remote branches from the most recent updated one to the oldest, with the author of the last commit on each branch.
But if you have to use GitHub API, then you would need to:
list the remote branches,
then for each one get the commit mentioned with the branch
You can then contact the committer of that most recent commit.

github Repository removal/deletion & github pages

If I remove/delete a public repository on gitHub, will it remove all of its clones as well? Secondly I want to share my gaming portfolio on github pages is there any way of doing that without having my repositorys cloned?
If you delete the repo from the GH site, it won't remove any clones created on local machines. It will delete everything on the site repository. You can configure GitHub Pages to publish your site's source files from any of these branches: master, gh-pages, or a /docs folder on your master branch. I'd check out this article, since it explains the details.

Github: how to restrict commits on a public repository

Is there a way to restrict users from making commits to a public repository? I may understand incorrectly, but private repos are not free, and also for private, users cannot access the repo unless invited as a collaborator. I would like GH users to still access the repo, but not able to push commits to it.
Thanks.
EDIT:
Thanks I looked at the link. It it still not clear to me because I used the clone url on the repo page and was able to clone and push to the master branch on the repo without even setting config user.name and user.email, which in my opinion seems like anyone else can do this as well.
I didn't notice a difference in read only git:// in the clone url as opposed to the read and write access way with git#. When I tried to push to another's repo using https (which has both read and write access), I got a 403 error (authentication error). The message included my GH username, which made me curious as to how GH knew that. Turns out they have a copy of the computer key that is initiating a push. So finally, only owners and collaborators can push to a repo. I was able to push to my own repo with the https because of my key.
git github cannot push to origin
How does GitHub handle push security?
You can try the Branch protection rule. it will restrict commits up to an extent. It is under Settings --> Branch

Github contributions for self created repos

I created a repo on Github and made some commits from the Github windows app, I checked that my email is in sync with my account.
In the "Repositories contributed to" tab I can only see third party repos but not ones created by me...
Does Github not count repos self created as "Contributions"? If they do, how can I show my commits in the "Repositories contributed" to tab?
Does Github not count repos self created as "Contributions"?
It does, but not in the list of "repositories contributed to".
That list is only for the repos your forked, made a PR (Pull Request) which was accepted and merged in the original repo.
Your own commits are counted in the contributions graph only if (see GitHub help page) all the conditions are met:
The commits were made within the past year.
The email address used for the commits is associated with your GitHub account.
The commits were made in a standalone repository, not a fork.
The commits were made in the default branch of the repository.

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

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