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

前端 未结 27 1084
南笙
南笙 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:31

    "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 abc@xyz.com

    • Or Change email id for one particular repository. From inside the particlar repository run below command

    git config user.email abc@xyz.com

    • Or in the repository open .git/config file and edit

    email = abc@xyz.com name = abc

    other causes can be found here https://help.github.com/articles/why-are-my-contributions-not-showing-up-on-my-profile/

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

    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

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

    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:

    1. Open git bash
    2. Clone a bare repository

      git clone --bare https://github.com/user/repo.git
      cd repo.git
      
    3. Paste the following code into the git bash console after changing the variables OLD_EMAIL, CORRECT_NAME and CORRECT_EMAIL:

      #!/bin/sh
      
      git filter-branch --env-filter '
      
      OLD_EMAIL="your-old-email@example.com"
      CORRECT_NAME="Your Correct Name"
      CORRECT_EMAIL="your-correct-email@example.com"
      
      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
      
    4. Press enter to run the script

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

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

    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.

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

    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.

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

    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 "xxxxxxxxxxx@users.noreply.github.com"
    

    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 xxxxxxxxxxx@users.noreply.github.com 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.

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