单人git项目 重置commit历史记录中的 提交人 提交邮箱
前提:
单人项目(不适合多人协作项目)
全局重置commit历史提交记录中的name和email
适合单人项目中,写错name与email后,重置项目的全部分支的commit历史
1. 安装 git-filter-repo
pip install git-filter-repo
2. 指定name和email
git filter-repo --force --commit-callback @" commit.author_name = b'新名字' commit.author_email = b'新邮箱' commit.committer_name = b'新名字' commit.committer_email = b'新邮箱' "@
3. 重新添加远程仓库(filter-repo 会移除 remote)
git remote add origin <your-repo-url>
4. 进行旧分支删除,与新分支推送
git push --force --all origin
作者:人间春风意
扫描左侧的二维码可以赞赏

本作品采用署名-非商业性使用-禁止演绎 4.0 国际 进行许可。

浙公网安备 33010602011771号