GitHub commits aren't recorded in the 'Your Contributions` calendar
GitGithubGit Problem Overview
I've been making continuous commits to my GitHub
repos from my linux shell and they show up nicely on the website just as they should. The only problem is that "Your Contributions" section doesn't show any recent activity. I have one green square from some day in November which I don't know how I got but all the other contributions don't show up in the calendar (but again, they do show up in their repos.
What am I missing here?
Git Solutions
Solution 1 - Git
For me this problem was caused by me committing from my work computer where I was using a different email in my gitconfig. Adding my work email address to my github account didn't make the past commits show up in the summary, but new commits are now showing up as they should.
You can find the email address you are using for a repository with git config user.email
.
Solution 2 - Git
from git
> I've just had a peek at your contributions for the GoTime2 repository > and it seems that you've been pushing commits to the layout branch. > > The reason why those contributions are not showing up is that we only > track commit contributions when they are made to the repository's > default branch or gh-pages branch: > > https://help.github.com/articles/why-are-my-contributions-not-showing-up-on-my-profile#which-contributions-are-counted > > Once your contributions are merged into the default or gh-pages, you > will get credited for them on the date you authored them.
so in my case I had to merge my 'layout' branch with the 'master' branch to see the 'your contributions' show up in the calendar.
Solution 3 - Git
This is a Github issue where sometimes their update mechanisms don't work and it turns into a "stale cache". This is nothing serious, simply send an email to [email protected] describing the issue and they'll fix it right away.
Solution 4 - Git
A possible cause for this:
>Commit was made in a fork > >Commits made in a fork will not count toward your contributions.
https://help.github.com/articles/why-are-my-contributions-not-showing-up-on-my-profile/
Solution 5 - Git
This did the trick! I just used $ git config user.email "my email address used on my git repo"
and it worked.
Solution 6 - Git
"You have to commit the changes with the same email id you used to login to your github account"
How to solve:
- Change global email id for all repositories using following command.
> git config --global user.email [email protected]
- Or Change email id for one particular repository. From inside the particlar repository run below command
> git config user.email [email protected]
- Or in the repository open .git/config file and edit
> email = [email protected] name = abc
other causes can be found here https://help.github.com/articles/why-are-my-contributions-not-showing-up-on-my-profile/
Solution 7 - Git
so this usually happens due to a lot of factors, for which you must visit this [GitHub help][1]
The most common mistakes I found were :
- Email not configured properly on local machine. (your laptop/pc).
- Forking.
- Not using default or gh-pages branch for commit.
I personally had issue 1 recently, for which I went to my terminal/cmd/cli and configure my email address locally by running this command
git config --global user.email yourname@email.address
Once that's done, try running this config again like this:
git config --global user.email
You should be able to see:
yourname@email.address
If this was correct, you have successfully configured your local machine with your global public repo. Now your next commit will be credited towards your calendar. [1]: https://help.github.com/articles/why-are-my-contributions-not-showing-up-on-my-profile/#which-contributions-are-counted
Solution 8 - Git
Make sure your local email is the exact same that the one in the account.
Go to the terminal and inside the folder you are pushing the commits, run:
git config --global user.email
#=> [email protected]
git config --system user.email
#=>
git config --local user.email
#=> [email protected]
Something similar was happening to me. The email in my account was the one in the --global, but my --local was slightly different, it had not '.'.
(In Gmail there is no difference between those emails, they work the exact same).
Solution 9 - Git
Maybe Github had fixed this problem. There is one simple way, go to github.com email setting: https://github.com/settings/emails
> Personal settings --> Emails
You can add email address there, and verify your newer email address with send a verification link, then you will find your previous commits are all recorded in the 'Your Contributions` calendar. And this email verification will also let you receive notifications and password resets from GitHub.
Your new email address will be used for account-related notifications (e.g. account changes and billing receipts) as well as any web-based GitHub operations (e.g. edits and merges).
Solution 10 - Git
I had the same issue in Xcode 9 for iOS development.
In Github, I noticed a non-committer author.
Even though I made commits in Xcode. There was no contributions in the 'Your Contributions` Calendar.
Solution:
Change Committer Name and Email Globally
The email address used for the commits must be associated with your GitHub account.
In the Terminal:
$ git config --global user.name "Full Name"
$ git config --global user.email "[email protected]"
See also GitHub Help: Setting your commit email address in Git
Solution 11 - Git
I solved it by making two changes
- I configured my local machine using command
git config --global user.email "your github email"
- I changed my default branch of my project repo from
main to master
using github website @ https://github.com/your-username/your-repo-name/settings/branches
`
Solution 12 - Git
I had issues seeing attributions for commits on a private repo that was added to my organization after many of my commits occurred (new commits were showing up properly) and was only able to get them to show up by removing the email address from my profile, then re-adding the same email address.
It seems like doing this cleared up a caching issue within GitHub.
Solution 13 - Git
Turns out I previously changed my email address on GitHub and I forgot to change the local one, too.
Solution 14 - Git
I hade to manually add my email to SourceTree settings even if git config
had the right email address configured. Only after doing this, GitHub started recording my commits to my contribution graph.
Solution 15 - Git
I had the same exact problem, turns out it is because the email on my local git does not match the email on my GitHub account.
To update the email on your local machine:
git config --global user.email "[email protected]"
Verify that all your commits are updated on your github, if not you can check individual commits to see what email the commit is associated with by clicking on the commit and adding ".patch" to the end of the commit url like this:
https://github.com/username/repoName/commit/9fbe83f71cfc3503.patch
Now all you have to do is add that email you see to your account.(It does not need to be verified)
Check the commit again and you should see your username and credited :)
Solution 16 - Git
I've just added my email again through the command line and it solves the issue:
$ git config user.email "[email protected]"
And another issue is about your branch. If you create another branch beside maser and try to push that branch this issue might occur. In my case I have started pushing to master and got the solution.
Solution 17 - Git
GitHub clearly states how they measure your contributions in their Help:
-
Issues and Pull Requests:
- Only if they were opened in a standalone repository, not a fork
-
Commits:
Only if they meet all of the following conditions:-
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 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
-
Note: After making a commit that meets the requirements to count as a contribution, you may need to wait for up to 24 hours to see the contribution appear on your contributions graph
Solution 18 - Git
I had the same problem and this worked for me: GitHub contribution checker, link below. Once installed, the program checks the validity of your recent commits and gives you a list of rules, with the rule/rules not met in red.
My problem was GitHub was using a Cygwin terminal name as an email address so I just added my Cygwin terminal name to my profile and all recent commits were added to my GitHub calendar.
Your commit will not be counted as a contribution! Check the details below: https://github.com/jdennes/contribution-checker
Solution 19 - Git
You can go to https://github.com/settings/emails and add the email that you are using with git config --global user.email
Solution 20 - Git
Had same problem, mine was fixed by setting the email
git config --global user.email jonathan.m2ndoza@gmail.com
Hope this helps.
Solution 21 - Git
I had the same problem and the solution was pretty simple. I had the wrong email set for the global email config
git config --global user.email "[email protected]"
>Just make sure the above email and your GitHub account email are same
Solution 22 - Git
The "Contributions Calendar" or "Activity overview" on github is only recording the commits that are related to the mail address that is recorded in the github account.
Change the mail address for all future commits
As already noted by many others in this thread, look up the current locally saved email address by:
git config user.email
If it doesn't match the mail on github, change using:
git config --global user.email my_email@gmail.com
This will globally change the mail address for all future commits but will not affect the "Contributions Overview" for the past ones. You can follow the official docs for an extended description.
Change the mail address to update the overview for the past commits
You realize that many of your past commits have not been recorded correctly in the Github "Contributions Overview":
To change that, you can change the author info for the repositories by following the steps explained in the official github docs.
A short summary:
-
Open git bash
-
Clone a bare repository
git clone --bare https://github.com/user/repo.git cd repo.git
-
Paste the following code into the git bash console after changing the variables
OLD_EMAIL
,CORRECT_NAME
andCORRECT_EMAIL
:#!/bin/sh git filter-branch --env-filter ' OLD_EMAIL="[email protected]" CORRECT_NAME="Your Correct Name" CORRECT_EMAIL="[email protected]" if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ] then export GIT_COMMITTER_NAME="$CORRECT_NAME" export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL" fi if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ] then export GIT_AUTHOR_NAME="$CORRECT_NAME" export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL" fi ' --tag-name-filter cat -- --branches --tags
-
Press enter to run the script
-
Push the corrected history to github
git push --force --tags origin 'refs/heads/*'
This procedure should update the "Contributions Overview" and now also show the commits not shown before:
Warning: This action is destructive to your repository's history. If you're collaborating on a repository with others, it's considered bad practice to rewrite published history. You should only do this in an emergency.
Solution 23 - Git
I contacted Github Team for the same issue and this was their response hope this helps some of you
Contributions are counted if they meet certain criteria, described here:
You can find out why a specific commit to a public repository is not counting as a contribution using this app:
https://contribution-checker.herokuapp.com/ this contribution checker is very helpful it solved my problem
People often find they are missing contributions because their commits were authored by an email address that is not associated with their GitHub account, as described here:
You can check the author of a commit by adding .patch to the end of the commit URL, like this:
https://github.com/github/linguist/commit/cfd5cbaba00122fceea1cfb108c5bdc3d451065a.patch
Solution 24 - Git
I fixed the similar issue by Using GitHub profile's username as my git username in my local environment.
As a example,
set global username as susithrj in your local git config.
> git config --global user.name "susithrj"
Solution 25 - Git
I had to restore my laptop recently and forgot to reconfig my email to git. My laptop username looks similar to my git one, so I just blindly thought my commits were being attributed correctly. As posted, you can change your global email settings. However, if you want to correct the miss-attributed commits on your project, you can use this run this script to create an alias gca
that you can run in your git project directory to change the authorship of your past commits.
From your ~
directory, add:
$ cat <<EOF >> ~/.aliases
function git_change_authorship {
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME=\"\$1\"
GIT_AUTHOR_EMAIL=\"\$2\"
GIT_COMMITTER_NAME=\"\$1\"
GIT_COMMITTER_EMAIL=\"\$2\"
"
}
alias gca=git_change_authorship
EOF
$ source ~/.aliases
then in your git project directory run gca <git username> <git email address>
Heads up! I have only used this in my own personal projects where I have been the sole committer. Haven't had a chance to test it out with group projects, so proceed cautiously.
Solution 26 - Git
I checked the "Insights" section/tab of my repository, and instead of my current user, there was a anonymous user (which was also me), so I changed the email config in my current computer to the one that I use github with as described above.
Solution 27 - Git
You can keep your email private and still have the contributions show up in your calendar. You can choose to keep your email address private from the github email settings and use the github noreply email address in your git config.
git config user.email "[email protected]"
Note
For me, I had chosen to keep my email private from the github email settings. This gave me an error
Your push would publish a private email address.
while trying to push to my repo. I removed the email. Pushing after this was successful but the contributions were not recorded in my calendar.
As mentioned by GitHub in the email settings page
> We’ll remove your public profile email and use > [email protected] when performing > web-based Git operations (e.g. edits and merges) and sending email on > your behalf. If you want command line Git operations to use your > private email you must set your email in Git.
Solution 28 - Git
Make sure to use the the user flag.
For example
git push -u origin
instead of
git push
Solution 29 - Git
I had the same issue and figured out that I was not pushing to the origin/main branch, rather to some other branch. I solved it by merging the two branches. In addition, even if the two branches are merged, if the origin/main
branch is behind several commits, still the contribution section would not update. one still need to do merging (kind of) to make sure that origin/main
branch is updated all the time, do:
Note: (this solution will easily work for the local repo which is pulling from one remote and pushing to a different targeted repo (problamacic one))
-
git pull origin main:temp
- This will pull the main to a temp branch (temp is local branch), but still
origin/main
branch is behind several commits if one is pushing in more than one branch system. We need to chekout to temp branch to merge/move it forwards (so to speak)
- This will pull the main to a temp branch (temp is local branch), but still
-
git checkout temp
- it will turn from:
(origin/main, origin/HEAD, temp)
to->>>>>>>>(HEAD -> temp, origin/main, origin/HEAD)
this means now HEAD is pointing totemp
branch, so we can make it move forwards (so to speak) several commits (or merge whichever the case may be).
- it will turn from:
-
git merge branch-second
- Now we want to merge to branch-second:
(origin/branch-second, main, branch-second)
locally, which is several commits above temp after merge looks like this:(HEAD -> temp, origin/branch-second, main, branch-second)
- Now we want to merge to branch-second:
-
git push origin temp:main
- Now push temp to main in the origin (origin means remote):
-
git log --all --decorate --oneline --graph
shows:(HEAD -> temp, origin/main, origin/HEAD, origin/branch-second, main, branch-second)
so, the origin/main is merged and pushed to branch-second and all are at the same levels, and contribution started to show up:) hope it saves your time
checkout my medium article on the same: Medium
Solution 30 - Git
Adding secondary email to GitHub helped not only with the current problem, but also to retrieve past commits/contributions.
If the email on local machine doesn't match the one in GitHub account - GitHub will not populate the contributions.
As it was answered before, run the following command to determine which email is being used on local machine: git config user.email
.
Proceed to https://github.com/settings/emails and add a secondary email, that you will find on your local machine.
Solution 31 - Git
for me was the file within the project:
/.git/config
...
[user]
name = your user
email = [email protected]
...
Inside the block [user] double-check the 'email' is correct (mine was incorrect) and the name is unique (mine was duplicated).
To double-check with contributor is increasing use:
git shortlog -sn
make a push, check which one is increasing the counter and that name should be the name inside the block [user]
Solution 32 - Git
To those who still can't make it work after type in correct(you think) email and name in git config:
Remove the quotation marks that wrap the email and name.
This works for me, careless me..
Solution 33 - Git
I resolved my error by :
I had uploaded the repo using :
git remote add url "my-repo-link"
git push url master
using url instead of origin did not show any green dots even after push ,
So , I created another repo , and re-init and commit and this time I write :
git remote add origin "my-repo-link"
git push origin master
All my previous commit to my ex-repo also added in my new repo ...saved my work and time