GitHub commits aren't recorded in the 'Your Contributions` calendar

前端 未结 27 1080
南笙
南笙 2021-01-29 21:59

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 \"Y

相关标签:
27条回答
  • 2021-01-29 22:14

    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/

    0 讨论(0)
  • 2021-01-29 22:14

    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).

    0 讨论(0)
  • 2021-01-29 22:14

    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

    0 讨论(0)
  • I fixed the similar issue by Using GitHub profile's username as my git username in my local environment.

    As a example,

    https://github.com/susithrj

    set global username as susithrj in your local git config.

    git config --global user.name "susithrj"

    0 讨论(0)
  • 2021-01-29 22:15

    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 "your.email@email.com"
    

    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 :)

    0 讨论(0)
  • 2021-01-29 22:16

    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.

    0 讨论(0)
提交回复
热议问题