git filter-branch 命令介绍

来源:互联网 发布:日本tpp知乎 编辑:程序博客网 时间:2024/06/15 16:07

我目前主要是想把git 记录里面的邮箱全部更换为一个邮箱 service@xxx.com

步骤

1:

#!/bin/sh -e

git filter-branch \
--env-filter '
case "${GIT_AUTHOR_NAME} ${GIT_AUTHOR_EMAIL}" in
*@google.com*)
export GIT_AUTHOR_NAME="hello"
export GIT_AUTHOR_EMAIL="service@hello.com"
;;
esac
case "${GIT_COMMITTER_NAME} ${GIT_COMMITTER_EMAIL}" in
*@google.com*)
export GIT_COMMITTER_NAME="hello"
export GIT_COMMITTER_EMAIL="service@hello.com"
;;
esac



0 0
原创粉丝点击