起因
我最近往自己Github Push了不少东西
然后我就发现Activity的绿点不加的?咋回事啊 我还想赛博点灯呢
然后我就看我最近的commit

这勾⑧是谁
我操了我突然想起来我git config的邮箱和用户名是乱填的
炸刚了 现在需要修复一下以前的commit
修复
Git config的改正
首先先打开git bash改一下
git config --global user.name "Cainongw"
git config --global user.email "mymail@gmail.com"
Commit历史的恢复
我没有什么多人协作的项目,自己写的东西直接改就好了
主要使用一个python小工具
pip install git-filter-repo
然后在要恢复的项目下面进行:
最好先把项目clone一次再操作
git filter-repo --email-callback '
return b"mymail@gmail.com"
' --name-callback '
return b"Cainongw"
'
然后他会删掉远端origin 手动重新add
然后push就好了
Hexo Deploy的设置
如果想每次Hexo Deploy都算一个commit的话只需要在hexo的_config.yaml设置一下
deploy:
type: git
repo: git@github.com:Cainongw/Cainongw.github.io.git
branch: main
message: "Site updated"
name: Cainongw
email: myemail@gmail.com
然后的话顺手写了个程序可以读取文章时间并创建commit
https://github.com/Cainongw/hexo-commit-generate
就酱吧(