问题:
在不同电脑之间不同的 git 邮箱账号,结果 commit 的时候忘记修改配置导致 commit 的名称和邮箱不对
解决方法:
修改Git配置
查看配置:
$ git config user.name
$ git config user.email
修改配置:
$ git config --global user.name "name"
$ git config --global user.email "email"
但是此方法只能补救以后的commit起效,如果想修改之前的作者信息,Github 给出了官方指南:Changing author info
修复git历史提交信息
To change the name and/or email address recorded in existing commits, you must rewrite the entire history of your Git repository.
为了修改 commit 的作者邮箱地址,你必须重写整个 git 仓库历史
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