mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-01 04:30:37 +02:00
change git current branch old email with new email in batches
This commit is contained in:
parent
ac9a8cb687
commit
6a45c9e53b
1 changed files with 17 additions and 0 deletions
|
|
@ -32,6 +32,23 @@ function work_in_progress() {
|
|||
echo "WIP!!"
|
||||
fi
|
||||
}
|
||||
#change current branch old email with new eamil
|
||||
gmvemail() {
|
||||
export OLD_GIT_EMAIL=$1
|
||||
export NEW_GIT_EMAIL=$2
|
||||
git filter-branch --commit-filter '
|
||||
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_GIT_EMAIL" ];
|
||||
then
|
||||
GIT_AUTHOR_EMAIL="$NEW_GIT_EMAIL";
|
||||
git commit-tree "$@";
|
||||
else
|
||||
git commit-tree "$@";
|
||||
fi' HEAD
|
||||
unset OLD_GIT_EMAIL
|
||||
unset NEW_GIT_EMAIL
|
||||
BRANCH_NAME=$(git symbolic-ref --short HEAD)
|
||||
git update-ref -d refs/original/refs/heads/${BRANCH_NAME}
|
||||
}
|
||||
|
||||
#
|
||||
# Aliases
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue