push commit to github,却没有contributions的原因与解决

其实这个原因很简单,是因为本地项目中git config中的user.email与github上的email不一致

在项目目录中通过git bash运行git config user.email 可以查看当前的email address

通过git config user.email "aabbcc@gmail.com", 设置email address,请保持本地的email address和远端github的email address的一致

之后再push,就能在contributions里看到自己的提交了

P.S 

如果有两个git账号,可以通过git config --local设置该文件夹的一些配置,相对的另一个参数是--global

引用

https://help.github.com/articles/why-are-my-contributions-not-showing-up-on-my-profile/  原因

https://help.github.com/articles/setting-your-email-in-git/   解决方案

原文地址:https://www.cnblogs.com/Raymond-Yang/p/5439093.html