Github contributions for self created repos - github

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.

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.

github branch restriction on personal account

I want to restrict commits to only few collaborators in few branches. I have personal account in github but donot have any facility to do so as that of organisation. Any suggestion is much appreciated.
You can always use GitHub's standard forking workflow:
Each collaborator will fork your repository and do their work in their own fork.
When something is ready to be contributed back to your repository the developer will create a pull request that you will review.
That code will only be merged into your repository if you approve it and accept the pull request.
In this way you control the code that gets merged into each of your branches.

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.

Find all user commits in a github repo

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

Github do not count my commit

This is the story.
I have two computers, one is in my home, another is in my office. Both computers have installed Eclipse and connect to the same project of my github account wtih Egit. I find that when I commit on my home computer, my commit will be recorded and display on my contribution graph. However, when I commit on my office computer, commits will not be recorded.
To solve this problem, I delete projects both on my home computer and office computer, and create new project by cloning corresponding project on github.com with identical steps. Furthermore, I use the same eclipse version, they are the newest Mars. However, the problem still remains, commits on home computer will be recorded, and the other will not.
I searched the Internet and can not find the answer. Is there anybody here can help me out? Thanks in advance!
Problem solved. If someone else meet the similar problem, the following link will be quite useful. https://help.github.com/articles/why-are-my-commits-linked-to-the-wrong-user
Just add your second machines SSH key (assuming you use them) to your account and you should be set. then clone your existing project from the repo, and start working normally. any changes, just commit/push, and from the other machine you can always pull any updates, vice versa.
Commits will appear on your contributions graph if they meet all of the following conditions:
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 repository's default branch (usually master)
In the gh-pages branch (for repositories with Project Pages sites)
In addition, at least one of the following must be true:
You are a collaborator on the repository or are a member of the organization - that owns the repository.
You have forked the repository.
You have opened a pull request or issue in the repository.
You have starred the repository.
Contributions to private repositories will only appear to users who can access those repositories. Those contributions are not rendered for users who cannot access those repositories.