我在别人的容器里面提交代码,结果用了别人的git name和email,结果commits的名字变成了别人的名字。
解决方法
git config user.name "New User"
git config user.email "newuser@gmail.com"
git log
git rebase -i 选择你要修改commits的前一个commit
把pick变成e,保存退出
git commit --amend --reset-author --no-edit
git rebase --continue
git push --force-with-lease
参考文献
[1].How to change the commit author for one specific commit?https://stackoverflow.com/questions/3042437/how-to-change-the-commit-author-for-one-specific-commit