博客地址:http://home.cnblogs.com/u/zengjianrong/

git 骚操作

1. 重写历史提交的email 或 author,可修改的包括:GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL, and GIT_COMMITTER_DATE

详见:https://git-scm.com/docs/git-filter-branch   https://cloud.tencent.com/developer/section/1138641

zjr@zjr-pc:~/disk/prjs$ git filter-branch -f --env-filter '
if test "$GIT_AUTHOR_NAME" = "william.tsang" 
then 
    GIT_AUTHOR_NAME=zeng.jianrong
fi
if test "$GIT_COMMITTER_NAME" = "william.tsang"
then
    GIT_COMMITTER_NAME=zeng.jianrong
fi
' -- --all

zjr@zjr-pc:~/disk/prjs$ git filter-branch -f --env-filter '
if test "$GIT_AUTHOR_EMAIL" = "514105868@qq.com" 
then 
    GIT_AUTHOR_EMAIL=zeng.jianrong@qq.com
fi
if test "$GIT_COMMITTER_EMAIL" = "514105868@qq.com"
then
    GIT_COMMITTER_EMAIL=zeng.jianrong@qq.com
fi
' -- --all


git
filter-branch -f --tag-name-filter //修改tag信息

 

2. 

 

posted @ 2021-06-23 19:26  black_man  阅读(77)  评论(0编辑  收藏  举报