github提交内容未记录

由于在配置git的时候,使用了默认的user.name和user.email,导致commit的内容没有被显示到github上,绿色小方块没有着色,下面给出补救方法

1.用git log查看commit log,其中Author部分的邮箱需要和github的一致,否则提交的内容不会在contribution中记录

2.如果邮箱内容不一致,需要手动配置一下:

$ git config --global user.name "github's Name"

$ git config --global user.email "xxx@xxx.com"

$ git config --list

 具体步骤参考:https://yuhongjun.github.io/tech/2017/04/26/Github%E6%8F%90%E4%BA%A4%E4%B8%8D%E8%AE%B0%E5%BD%95Contributions.html

3.修改提交记录中的邮箱内容,重新提交:

具体步骤参考:https://docs.github.com/en/enterprise/2.18/user/github/using-git/changing-author-info

原文地址:https://www.cnblogs.com/Jay-CFD/p/14380296.html