Skip to content

Instantly share code, notes, and snippets.

@anil-kk
Created April 16, 2020 09:57
Show Gist options
  • Save anil-kk/44288a6d02e297250a39808744a173cf to your computer and use it in GitHub Desktop.
Save anil-kk/44288a6d02e297250a39808744a173cf to your computer and use it in GitHub Desktop.
Rename git commits author details to a repo
git clone --bare https://github.com/user/repo.git
cd repo.git
_____________________________
copy the below commmands to help.sh file and make it executable by running this command
chmod +x help.sh
./help.sh
________________________________________________________________________
#!/bin/sh
git filter-branch --commit-filter '
if [ "$GIT_COMMITTER_NAME" = "SomeWrongName" ];
then
GIT_COMMITTER_NAME="Anil Kumar Kothapalli";
GIT_AUTHOR_NAME="Anil Kumar Kothapalli";
GIT_COMMITTER_EMAIL="[email protected]";
GIT_AUTHOR_EMAIL="[email protected]";
git commit-tree "$@";
else
git commit-tree "$@";
fi' HEAD
___________________________________________________________________
git push --force --tags origin HEAD:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment