Rewriting Commit Messages in Git

preview_player
Показать описание
Two quick ways to rewrite a previous commit's message in git:
- use `git commit --amend` to redo the last commit's message
- use `get rebase -i HEAD~N` to look over & reword the last N commits

Useful links:

00:00 intro
00:15 change last commit with `git amend`
00:45 go further back with `git rebase`
Рекомендации по теме
Комментарии
Автор

People like you deserve all the praise in the world. You are here to do one thing and one thing only and it is exactly what you did. No bullshit talking for 30 minutes, straight to the point and easy to follow. Much appreciated.

nkfxznl
Автор

This was exactly what I needed. In the Git manual online it isn't very clear to me that my editor will pop up twice. You made this very clear and painless. Thank you!

erichepperlewp
Автор

Awesome video! This was a great refresher for me who has not used rename in a while.

stephanie_ong
Автор

This really helped me so much. Thank you Eric. I never new the command :wq existed and was wondering how on earth I could continue in VIM with the rebase. Much appreciated.

ahmeda
Автор

Thank you for this! Worked like a charm

andrewmriv
Автор

God level tutorial. You saved me hours of headache :)

jaydraws
Автор

this is awesome
thanks for the video it helped me a lot👌

timothytimm
Автор

Thanks man!
Thanks a lot!
I was shit scared because I was going to undo the commit for a month work xD

prateekchourasia
Автор

Thank you, sir, thank you very much.

TasniMarwane
Автор

I am using rebase a lot lately ... thankyou *Y(

avimehenwal
Автор

At 2:13 when you wrote the commit, how did you get to the buttom?
edit* Fix the issue. Press shift and colon( : ) at the same time -> shift + :

ismailkassim
Автор

So you have to count back how many commits you need to go? That's really special.

ItsEverythingElse
Автор

no changes i can see it is as it is on website how long it takes to apply changes!!

sarveshchavan
Автор

Wow 8 year ago xD how are u doing nice video btw

diwakardayal
Автор

Hi how do i rewrite 3 commits when i posted them to github already? all 3 say first commit i want to change them. :)

millieandcupcake
Автор

Hi, thanks for your video, however I keep running into the same issue which is driving me insane. Happens whether I use terminal in VS Code or the Terminal app.


I enter git rebase -i HEAD~2 which opens the screen you see at 01:23. Then the weirdness happens.

It won't let me replace pick with reword instantly. At first I'll start typing out reword but nothing happens, then after a couple of seconds it finally lets me do it. I'm assuming you're hitting the ENTER key to go to the next screen right? If I hit ENTER all it does is add a backspace. I basically cannot move past this screen, all I can do is Ctrl + C and then :qa! to get out of it.

Any help would be much appreciated. Thanks in advance!

LignariusDM
Автор

What would you do on the final screen if you were rewording multiple commits? Do you go to a new line and type the message?

jonathanharris
Автор

Nice tutorial, thanks. But how can we push updated commit message to remote branch ?

mansishah
Автор

Hi Eric, so the second editor appears automatically right after you :wq the first editor? Thanks,

AG-imdz
Автор

What if it's like 50 commits long ago?

hyfydistro