Alwaysblue
Alwaysblue

Reputation: 11830

Git contributions not showing up on GitHub

I went through your following article https://help.github.com/articles/why-are-my-contributions-not-showing-up-on-my-profile/ for contribution not being shown on my profile.

To say the least.

[Question:] Can someone tell me what wrong I could be doing? or how to fix it?

My git repository is: https://github.com/irohitb

Example: Consider this repository -> https://github.com/irohitb/Crypto, Here it says last commit was pushed 4 days ago but in my contribution, it doesn't show any contribution which I did in past week

Upvotes: 10

Views: 12753

Answers (4)

Eberhard Hüsch
Eberhard Hüsch

Reputation: 11

Just do it again:

git config --global user.name "usuario"

git config --global user.email "[email protected]"

simple like that... happens to me once...

Upvotes: 1

Ahmed Mansour
Ahmed Mansour

Reputation: 545

In some cases, the git configuration on your computer might have the wrong email address. In my case it was, for some reason, set to the computer name so wasn't even an email. To check this, go to a commit that is not showing in the graph and add ".patch" to the end of the URL. This will show you the email address of the committer.

To change the author info on your commits, you can follow this help article on github. It has a script that will rewrite the history of all your commits and fix the author/committer info.

From the article:

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.

Any collaborators will have to fetch the new history.

Note: Running this script rewrites history for all repository collaborators. After completing these steps, any person with forks or clones must fetch the rewritten history and rebase any local changes into the rewritten history.

Steps from the article:

  1. Create a fresh bare clone git clone --bare https://github.com/user/repo.git
  2. Copy and paste the script, replacing the following variables based on the information you gathered:

    OLD_EMAIL CORRECT_NAME CORRECT_EMAIL



    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

Upvotes: 1

umläute
umläute

Reputation: 31274

GitHub uses only the commiter's email-address to determine their "identity".

If you use multiple email addresses, you can add all of them on GitHub's Setting page.

Note, that you have to validate each email address you want to add: so you really can only add valid (as in: they are accepted by a public mailserver) email addresses. an address like <[email protected]> cannot be validated, so you can't add it (and you should use git config user.email to set a valid email-address instead.)

PRO tip: you git config --global user.email to set your user-email for all repositories not just the one you are currently working with (a repository-local configuration will override the global settings).

Upvotes: 2

VonC
VonC

Reputation: 1323753

Check your git config user.name and git config user.email.

Your user.name should be irohitb, after your GitHub account.

The commit of the repo you mention (commit 0733750) shows:

Rohit Bhatia authored and Rohit Bhatia committed 4 days ago

In both instances, GitHub does not show a link to github.com/irohitb, which means the user.name or user.email didn't match the login/email of your GitHub account.

You would need to change the author of your past commits to rectify the situation.
See this example.

Upvotes: 14

Related Questions