场景:
在公司电脑,使用自己的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
本文介绍如何在公司电脑上使用个人GitHub账号,通过修改.git文件夹中的配置,实现以不同用户名和邮箱提交代码的方法。包括进入仓库.git目录,使用cat和git config命令修改name和email,确保提交记录正确反映提交者身份。
2141

被折叠的 条评论
为什么被折叠?



