-
-
Save bgromov/a1905055a8b9cdbeb1d2a87e70920cc8 to your computer and use it in GitHub Desktop.
Thank you bro : )
Thank you!
@bgromov , Newname is our github id or actual name?
Thanks!
Nice! This even keeps old timestamps!
To push to a remote afterwards, a --force
is needed.
git push --force --tags origin 'refs/heads/main'
# or
git push --force
Credits to the comments of https://stackoverflow.com/a/750191/8940679
Thank you so much! This really helps when you change from a personal handle to a business one.
Thank you so much!
Thank you
Thanks! I get this warning though.
WARNING: git-filter-branch has a glut of gotchas generating mangled history
rewrites. Hit Ctrl-C before proceeding to abort, then use an
alternative filtering tool such as 'git filter-repo'
(https://github.com/newren/git-filter-repo/) instead. See the
filter-branch manual page for more details; to squelch this warning,
set FILTER_BRANCH_SQUELCH_WARNING=1.
Proceeding with filter-branch...
Rewrite 2a51e47ec68d9fb91xxxxxxxx (2/2) (0 seconds passed, remaining 0 predicted)
WARNING: Ref 'refs/heads/main' is unchanged
Can you suggest something?
Thanks, works brillant.
Thanks :)
Thanks :)
thanks
thanks
Thanks a lot!
Thanks. To update only your commits and not all ( even if not yours):
#!/bin/sh
git filter-branch -f --env-filter '
OLD_EMAIL="xxxxxxxxxxxxxxxxxxxxxxxxxx"
CORRECT_NAME="zzzzzzzzzzzzzzzzz"
CORRECT_EMAIL="yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
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
' HEAD
Thank you so much!
Thank you very much
Awesome! Thank you
Thanks a lot.
Thanks
Thank you a lot!
@bgromov , Newname is our github id or actual name?
both will work.
git filter-repo
solution:
git filter-repo --preserve-commit-hashes --name-callback "$(cat <<'EOF'
return b'<replace everything between the quotes with your name>'
EOF
)" --email-callback "$(cat <<'EOF'
return b'<replace everything between the quotes with your email>'
EOF
)"
If you had signed your commits before this, note that the above command will remove those signatures. For me, this answer was useful to resign all commits without loosing commit dates.
Works good, except merge commits, where it still shows the another user
Work fine. Thank you.
Thanks you very much)