Git:修改author:修订间差异
已建立頁面,內容為 "<source lang="bash"> </source> https://help.github.com/en/articles/changing-author-info Category:Program" |
无编辑摘要 |
||
第1行: | 第1行: | ||
<source lang="bash"> | <source lang="bash"> | ||
git clone --bare xxx | |||
git filter-branch --env-filter ' | |||
OLD_EMAIL="dr@riguz.com" | |||
CORRECT_NAME="Riguz Lee" | |||
CORRECT_EMAIL="solee.linux@gmail.com" | |||
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ] | |||
then | |||
export GIT_COMMITTER_NAME="$CORRECT_NAME" | |||
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL" | |||
fi | |||
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ] | |||
then | |||
export GIT_AUTHOR_NAME="$CORRECT_NAME" | |||
export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL" | |||
fi | |||
' --tag-name-filter cat -- --branches --tags | |||
git push --force --tags origin 'refs/heads/*' | |||
</source> | </source> | ||
2019年6月10日 (一) 08:54的最新版本
git clone --bare xxx
git filter-branch --env-filter '
OLD_EMAIL="dr@riguz.com"
CORRECT_NAME="Riguz Lee"
CORRECT_EMAIL="solee.linux@gmail.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_AUTHOR_NAME="$CORRECT_NAME"
export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
fi
' --tag-name-filter cat -- --branches --tags
git push --force --tags origin 'refs/heads/*'