场景:
在公司电脑,使用自己的github,使用不同的用户名和邮箱提交。
方法:
进入仓库的.git 文件夹
sudo cd {项目路径}/.git
查看当前配置:
cat config
修改name
git config user.name "{name}"
此处"{name}"是github中Public profile下的Name
修改email
git config user.email "{username}@users.noreply.github.com"
此处"{username}"就是github中点击头像,Signed in as 后面的那个名字,也是生成代码路径中标识的那个名字
转载自 https://blog.youkuaiyun.com/Dorothy1224/article/details/90175395
修改重置历史提交的author
git commit --amend --reset-author