How to Change Author on Git Commits on an Entire Repository

  Рет қаралды 24,800

Tutorial Tim

Tutorial Tim

Күн бұрын

Пікірлер: 90
@がんすき
@がんすき 2 жыл бұрын
Thank you for this! very helpful and straight to the point.
@TutorialTim
@TutorialTim 2 жыл бұрын
Thank you!
@siegblink182
@siegblink182 4 жыл бұрын
Super amazing! This saved me a lot of time fixing the author mixup issue in my Github account. Thank you very much.
@TutorialTim
@TutorialTim 3 жыл бұрын
Thank you!
@junioranheu
@junioranheu 3 жыл бұрын
Thank you very much, it worked like a charm. For those who are struggling with the "bad revision" error, don't use Windows or GIT CMD, use the Windows Powershell instead
@TutorialTim
@TutorialTim 3 жыл бұрын
Awesome, glad it helped!!
@TomChristerSchöön
@TomChristerSchöön 6 ай бұрын
This really helped me, thanks a lot man!
@ankitaghadge.1337
@ankitaghadge.1337 2 жыл бұрын
How can i permanently change author name for commit for all repositories?? Every time when i am doing first commit to pushing the project on GitHub its showing someone else author name. What i can do?
@jen24499
@jen24499 Жыл бұрын
Real hero who saves people from ShitHub tortures... Ty man! Btw, whoever is wondering if it works on Windows or not, the answer is yes. I'm using Win10 and it works fine, just repeat for the author.
@TutorialTim
@TutorialTim Жыл бұрын
Lol this comment made my day! Thank you for watching and glad this video helped! Keep on committin' 😎
@clipshistoricosca8326
@clipshistoricosca8326 2 жыл бұрын
THANKS MAN! this literally saved all of my coding work that didnt appear!!!!!!!!!! thanks really appreciate it!
@TutorialTim
@TutorialTim 2 жыл бұрын
Glad I could help, happy coding! xD
@m4heshd
@m4heshd 3 жыл бұрын
By the way, the SHA-1 commit hash is not a feature of GitHub. It's a core feature of Git. Also when you perform this all the SHA-1s will change because how the commits are chained to each other using this hash. It's a dangerous thing to do on a mature repository with multiple authors or other functionality referencing hash.
@TutorialTim
@TutorialTim 3 жыл бұрын
Updated the description of the video. Thanks!
@m4heshd
@m4heshd 3 жыл бұрын
@@TutorialTim Wonderful. 👍🏻
@liambirt3758
@liambirt3758 3 жыл бұрын
​@@TutorialTim hey Tim, thanks for the video but I'm a bit confused by this particular chain (relatively new to Linux, Git & Github). I forked a pretty sizable repo and got the hyperlink of my forked version, then went to my CLI and ran: "git clone --bare " My goal is to swap all company names and abbreviations within the code and author information out of my fork and as I add on then I can just do so in their original repo. That said, I don't want to change authors in their repo ha and I'm also not finding how you changed everything within the code (markdown)?
@almirsantos99
@almirsantos99 5 жыл бұрын
You're insane dude, really thank you, i maded thousands commits on "ubuntu" user (lol), now i have it to my account. Amazing
@TutorialTim
@TutorialTim 5 жыл бұрын
Ahhh thank goodness! Bet that commit history is looking beautiful now haha
@Caveine
@Caveine 2 жыл бұрын
my godness its work, thanks man.
@TutorialTim
@TutorialTim 2 жыл бұрын
Thank you!
@junialdy
@junialdy 2 ай бұрын
Thank you! this really helped me
@rabbymir5934
@rabbymir5934 2 жыл бұрын
Great video, thanks! I had committed using my work e-mail same as you.
@vommir.
@vommir. 8 ай бұрын
Thank you, thank you, thank you!
@g.t.3482
@g.t.3482 2 жыл бұрын
It was very helpful and quick! thanks for posting this...
@TutorialTim
@TutorialTim 2 жыл бұрын
Of course!
@ciaran487
@ciaran487 2 жыл бұрын
Great tutorial thanks Tim!
@TutorialTim
@TutorialTim 2 жыл бұрын
Thank you!
@info662
@info662 2 жыл бұрын
still works in 2021. Thanks man
@TutorialTim
@TutorialTim 2 жыл бұрын
Woot woot!
@tejashelwatkar7894
@tejashelwatkar7894 4 жыл бұрын
Great tutorial. Thank you so much!!
@kylamarjes3438
@kylamarjes3438 2 жыл бұрын
thank you for this tutorial. it works for me!
@TutorialTim
@TutorialTim 2 жыл бұрын
Thank you!
@irazirfan
@irazirfan 4 жыл бұрын
omg! that did work! You are the boss man, thanks a lot for sharing :)
@ajetunmobiisaac3152
@ajetunmobiisaac3152 3 жыл бұрын
Thank you, this was really helpful
@TutorialTim
@TutorialTim 3 жыл бұрын
Awesome, glad I could help!
@yuvrajsingh-my5oz
@yuvrajsingh-my5oz 3 жыл бұрын
Thanks a ton bro....You really saved me...
@chiragranpara9580
@chiragranpara9580 4 жыл бұрын
Thanks buddy! it is really helpful
@malikhaseeb6236
@malikhaseeb6236 2 жыл бұрын
Man you saved my life. Thank you
@TutorialTim
@TutorialTim 2 жыл бұрын
You bet! Gotta have those commits logged accordingly lol
@timmymanamperi
@timmymanamperi Ай бұрын
thanks heaps for the video very useful one for me. tc
@iuryweblondon
@iuryweblondon Жыл бұрын
Awesome, you saved me, thank you!!!
@cameronpartee2949
@cameronpartee2949 2 жыл бұрын
Thank you thank you!! This saved my life!! :)
@TutorialTim
@TutorialTim 2 жыл бұрын
Thank you, Cameron! :)
@gurmukhsingh-uh5qo
@gurmukhsingh-uh5qo 3 жыл бұрын
thanks for sharing, worked great
@zayan184
@zayan184 3 жыл бұрын
not working in my case 😭
@JobinSelvanose
@JobinSelvanose 2 ай бұрын
Thanks
@eBlackize
@eBlackize 3 жыл бұрын
I'm getting an error saying "zsh: event not found: /bin/sh"
@ferozahmed3496
@ferozahmed3496 11 ай бұрын
It's amazing! How can I run this script for another branch? Is it possible?
@stefano_girardelli
@stefano_girardelli 5 жыл бұрын
Amazing tutorial! This was the only way I could fix it. Thank yout!
@TutorialTim
@TutorialTim 5 жыл бұрын
Glad I could help!
@mansithakkar4725
@mansithakkar4725 3 жыл бұрын
I followed the same it worked but it created duplicate commits with new details ... How to remove all duplicate one??
@ankitaghadge.1337
@ankitaghadge.1337 2 жыл бұрын
I can able to change the author name for the commit but the old author name is still there in contributors. How can I remove it?
@leenabhandari5949
@leenabhandari5949 2 жыл бұрын
helpful, Thanks!
@HaoTran-hd7io
@HaoTran-hd7io 3 жыл бұрын
you save my day, thanks a lot :D
@Qwerter1410
@Qwerter1410 5 жыл бұрын
Thank you!
@srinidhisaravanan2764
@srinidhisaravanan2764 2 жыл бұрын
Hi, thanks for this method, but even after rewriting, it is not reflecting in the github remote, can anyone help me
@樊腾飞
@樊腾飞 3 жыл бұрын
Hi Tim, it worked in the default branch master, but some commits in other branch like dev, but the question is i couldn't update email in this branch, it seems only update your default branch , when i try to checkout branch to dev, it said: fetal: this must be run in a work tree
@FedericoCuelhoLariau
@FedericoCuelhoLariau 2 жыл бұрын
Does this procedure change the datestamps on all commits to the date you are correcting the author?
@piyuinshort
@piyuinshort 3 жыл бұрын
Wow! it works!!!
@AnagheemAzzam
@AnagheemAzzam 4 жыл бұрын
Hello Tim, thanks for the tutorial! I'm on Windows, I tried solving the problem that I have undefined accounts other than my actual account committing to my repo on GitHub. I tried running your script but it keeps showing that error on terminal "fatal: bad revision 'OLD_EMAIL=my_old_email'
@TutorialTim
@TutorialTim 4 жыл бұрын
It may be that the OLD_EMAIL variable doesn't have the right e-mail account due to a typo? I would also double check the account you're currently signed into with the command `git config --global user.email` and see which account you're currently on. You can change it with the following: git config --global user.email "email@mail.com" Let me know if that helps!
@AnagheemAzzam
@AnagheemAzzam 4 жыл бұрын
@@TutorialTim Thanks for replying. No actually I tried this solution and others before watching your video and nothing worked. when I run the command to check my current email and user name that commits to the repo, it shows my actual and correct username but on the repo there's an undefined username committing instead of the actual one with my pic and so on.
@TutorialTim
@TutorialTim 4 жыл бұрын
Did you paste into a notes editor to modify the values linked to the variables? If so I would recommend replacing the quotations in a code editor as pasting into apps such as Notes can convert your quotes into curly quotes. I'd ensure that they're all straight quotes. Hope this helps!
@ramis2963
@ramis2963 Жыл бұрын
Great video Can someone know that i changed the email or not ? Thanks
@TutorialTim
@TutorialTim Жыл бұрын
'git log' your commits after making the changes to see who the commits belong to.
@ernestandersonhutasoit9410
@ernestandersonhutasoit9410 4 жыл бұрын
Thanks, it work. But when i push again it got error. I can avoid error with --force when push it but the author changed back to normal Is it really work like that or i make mistake?
@alimeree4299
@alimeree4299 3 жыл бұрын
Error : zsh: event not found: /bin/sh How to solve this error pls!!!?
@dissonance110
@dissonance110 5 жыл бұрын
Hi Tim, great tutorial! Do you know if there would be any issues caused if I did this one a group repo? Looking over the commit history I noticed my contributions were like this and wanted to change them to the correct username/email. Any help you can give me would be great!
@TutorialTim
@TutorialTim 5 жыл бұрын
Dissonance no issues, it will just overwrite your commits with the username u specified in the script and replace them with the new one you want. Let me know if that works.
@dissonance110
@dissonance110 5 жыл бұрын
It worked on one project, but not another. I can't tell the difference between the two, but I'll keep digging
@devilattack-to9ok
@devilattack-to9ok Жыл бұрын
my username and mail is getting changed but I cant see my profile pic in front of them like you. can you please address me.
@kiattim2100
@kiattim2100 3 жыл бұрын
the result shown "Ref 'refs/heads/main' was rewritten" But nothing happen, I'm sad.
@TutorialTim
@TutorialTim 3 жыл бұрын
Even when u run git log nothing happened? Sounds like your commits have been rewritten
@kiattim2100
@kiattim2100 3 жыл бұрын
@@TutorialTim yeah, I might mess with it too much. Right now I'm trying the .mailmap method with git shortlog command and it shows a correct email now, but on the website the commit history is still the same. at this point I will just wait for a few day lmao.
@kiattim2100
@kiattim2100 3 жыл бұрын
@@TutorialTim ok It worked! now.. well actually my dumbass forgot to push the update lmao thanks you so much!!
@TutorialTim
@TutorialTim 3 жыл бұрын
@@kiattim2100 your not dumb! Just trial and error, happens to me all the time! Happy coding!
@DrogonTheDread
@DrogonTheDread 2 жыл бұрын
Brill thanks all my commits where just sent from git :0
@TutorialTim
@TutorialTim 2 жыл бұрын
Excellenttttt
@brucew6508
@brucew6508 5 жыл бұрын
WARNING: Ref 'refs/heads/master' is unchanged my result is not rewritten, what can i do next?
@TutorialTim
@TutorialTim 5 жыл бұрын
Hi Bruce, send me your email so we can work together on resolving your issue!
@brucew6508
@brucew6508 5 жыл бұрын
@@TutorialTim Thank you! I just solved it. The secret is to enter the correct OLD_EMAIL. LOL. Your method is perfect.
@TutorialTim
@TutorialTim 5 жыл бұрын
@@brucew6508 lol noice. glad you figured it out on your own!
@harrisongreeves8561
@harrisongreeves8561 5 жыл бұрын
I'm having the same issue. I've tried both of my old emails but I get the same error. Any idea where to find the email associated with the commits on GitHub?
@SanjitKumar-kh1hj
@SanjitKumar-kh1hj 4 жыл бұрын
A year late, but I seem to have the same issue. But I've checked my old email, it seems to be right. @Tutorial Tim Any help would be nice. Thanks!
@mikechadwick2785
@mikechadwick2785 4 жыл бұрын
holy shit thank you
@thecode9078
@thecode9078 Жыл бұрын
Destroyed my entire project insights, thanks a lot
@abdullahasmkilic3405
@abdullahasmkilic3405 3 жыл бұрын
You really helped me. Thanks so much man!
@TutorialTim
@TutorialTim 3 жыл бұрын
Of course!
How To Squash Your Git History Like A Pro
13:09
Colt Steele
Рет қаралды 55 М.
Git Tutorial For Dummies
19:25
Nick White
Рет қаралды 1,1 МЛН
когда не обедаешь в школе // EVA mash
00:51
Life hack 😂 Watermelon magic box! #shorts by Leisi Crazy
00:17
Leisi Crazy
Рет қаралды 73 МЛН
Incredible: Teacher builds airplane to teach kids behavior! #shorts
00:32
Fabiosa Stories
Рет қаралды 12 МЛН
13 Advanced (but useful) Git Techniques and Shortcuts
8:07
Fireship
Рет қаралды 918 М.
Intro to GitHub - Commits, Issues, Pull Requests, Releases, and more
1:09:28
The Fastest Losses of Magnus Carlsen's Career
12:58
Classical
Рет қаралды 9 МЛН
git commit
17:43
Java Shastra
Рет қаралды 347
Git Fork vs. Git Clone: What's the Difference?
9:41
Eye on Tech
Рет қаралды 77 М.
How to edit your Git Commit History
5:11
Shobhit Walia
Рет қаралды 3,3 М.
Git It? How to use Git and Github
12:19
Fireship
Рет қаралды 763 М.
How to change git commit author name
3:58
Muhammad Talha
Рет қаралды 2,6 М.
когда не обедаешь в школе // EVA mash
00:51