Learn how to rewrite Git history - Amend, Reword, Delete, Reorder, Squash and Split
Вставка
- Опубліковано 23 чер 2024
- In this video I'll dive into some of the ways Git allows us to rewrite commit history. Specifically I cover: amending commits, rewording commit messages, deleting commits, reordering commits, squashing commits and splitting commits.
FULL WRITEUP: www.themoderncoder.com/rewrit...
MORE GIT VIDEOS: • Git
CHAPTERS
0:00 Intro
0:40 Amending commits
2:04 Rewording commits
4:14 Deleting commits
5:34 Reordering commits
7:04 Squashing commits
9:09 Splitting commits
MY TECH
2020 M1 MacBook Air (I have the 512GB variant): amzn.to/3TTIBsE
AirPods Pro: amzn.to/3sRLUo5
Gaming headset: amzn.to/3zwbT8i
Headphones (newer model): amzn.to/3Ub5reT
Keyboard: amzn.to/3FOOOC7
Mouse: amzn.to/3WhMFV9
Monitor: www.dell.com/en-us/work/shop/...
Monitor arm (newer model): amzn.to/3gXnlUa
Webcam: amzn.to/3zxxwp0
TECH ACCESSORIES
Laptop stand: amzn.to/3NuyqZ5
Mouse pad/mat: amzn.to/3U9QFVO
KVM switch: amzn.to/3gZmpP0
PC case: amzn.to/3Fx4Hg5
Under desk drawer: amzn.to/3WloFAo
VIDEO GEAR
Camera: amzn.to/3WkbiRe
Lens: amzn.to/3zxiTC4
Microphone: amzn.to/3SSUoWE
Main key light: amzn.to/3WhZbny
Secondary light: amzn.to/3fpRefx
^ Note for the Amazon links above: as an Amazon Associate I earn from qualifying purchases.
ABOUT ME
I'm a professional software engineer working at Amazon in New York City. I enjoy making videos about the tech industry so if you have a question please get in touch either through the comments or any of my socials and I'd be happy to help out. Thanks for checking out the channel!
FOLLOW ME
Website: www.themoderncoder.com
Instagram: / themoderncoder
Twitter: / themoderncoder
Join the email list for tips curated to improve your dev skills delivered monthly to your inbox: www.themoderncoder.com/email-...
I HAVE MORE GIT VIDEOS! ua-cam.com/play/PLfU9XN7w4tFwKwh_xPSQ_X1-hROQEpHnM.html. Additionally, a written reference for this video is available on my blog: www.themoderncoder.com/git/
Pure gold! Learnt faster in those 12 mins than reading any book.
put the timestamps before the topic in the description and UA-cam will automatically add chapters to the progress bar
0:00 - intro
0:40 - Amending commits
2:04 - Rewording commits
4:14 - Deleting commits
5:34 - Reordering commits
7:04 - Squashing commits
9:09 - Splitting commits
The "0:00" is needed
thx
Good tip thanks. I went ahead and made those changes
Thank you very much for your content. Extremely helpful. Love the animations, they make it so easy to wrap your head around the concepts.
Concise and straight to the point.
Bravo!
This was gold, helped me a lot. Definitely great teaching abilities.
Very well explained! Super good with the visual branches to better understand what's happening
Dude it really helped me a lot i was missing the few of these concepts of git thank you.
Can't express how thankful I am to you. So accurate and informative. Thank you indeed
Best explanatory video on all this subjects! Thanks and keep up the good work!
Great explanation and the graphical representation you used while typing the commands made it much easier to understand from a visual perspective. Keep up the good work!
This is the best tutorial of git I have ever seen.
Thanks man
Really like the video, and the written blog is good too. Clear, concise and to the point.
Omg did not know that is possible to reording commits. So darn simple! Thank you!
Awesome video! Great example of explaining stuff to the point with really good examples.
You have a gift for teaching. Very concise and easy to understand.
Simply the best GIT explanation ever, super concise and really helped me get out of a pickle today !!! THANK YOU !
Your Git Videos are really helping me to play with my commits & branch at work. Thank you so much.
Very clear and concise explanations - thanks.
Great job! Explains everything so easily :)
Best, clearest git tutorials by a country mile. Thanks.
Great concise explanation of everything that might matter to someone!
Excellent! Thank you so much for this video. I have struggled with rebasing and was scared. But your teaching skill is excellent and I learnt in few minutes and used it successfully.
This channel is COMPLETELY underrated. You deserve a tonne more subscribers. Keep consistently making quality videos such as this, and you will make it bigger in no time!
These videos are fantastic!
best series on non-basic git, congrats
Good job this video looks edited by a professional company, the animations really help, keep up the good work
Short and precise. Good job sir
Over and over hank you again to express yourself in so clear way
I came to Git from SVN -- and the ability to modify history was probably the hardest thing to wrap my head around. Not only that it was possible, but that there were situations where it is actually desirable! Now ... well, I could not go back to SVN! 🙂
Clear and crisp. Thank you.
Great tutorial! Very useful and nicely explained.
This is the best video by far I have seen on UA-cam. Thank you so much man....
This is just a great tutorial!
3 hours of other videos in 13 minutes. Awesome. Thanks a lot
You make a really good teacher...
I wish you wouldn't have stopped uploading git tutorials, they are by far the best I've seen and I've seen many
Awesome buddy! I'm trying to go deep into git.. and this video was gold.
Great job! great explanation!
Very informative with awesome explanation.
Wow. You made it so easy to learn. Thank you 🙏
Voila...you gained a subscriber.. just loved the way you explain technically and practically
I'm thankful for your content
I mean, so many comments before have said this, but I need to confirm: this tutorial was more clear and understandable than the articles and other videos I watched about rebasing and changing Git commit history! I get it now!
Wonderful !! Thanks for this video man.
Very good video. Well explained. Thank you!
I have searched for answers and videos I didn't get anywhere, but the way you explain git is amazing and one of the best explanations ever seen. You are soo good at Git man. Thanks for the Video. Please make more videos. I love it
This is the best explanation I have seen for Git's commands, and they are real world solutions for real world problems. Thank you very much.
Great video, so clean explanation.
Absolute life saver! Thanks a ton for this.
Was stuck on a PR as I was unable to edit a commit's changes this video saved me. Really helpful
Subscribed!
You might be the only UA-camr I have an occasional compulsion to listen to at lower than normal speed :D
Thank you so much for this compilation
Thank you for this superb video. Awesome animation and edit makes this video more awesome.
Great video !! Couldn't have explained it any better !!
Amazing Dude!
Thanks for your video.
Thanks for making this video. This has solved most of my problems.
Been 2 days trying to learn how to delete a commit and you just came and and did it in 2 minutes
It is crazy this is free content!
git rebase is a very powerful tool. Thanks for sharing your knowledge :)
All things I've done before, but I do them so infrequently I forget the work flow... thank you so much for the walk through!
Excellent video!
Thanks man..it really cleared the doubts✌️
Thank you so much. Very good tutorial. and good animation too
Awesomeee!!! Thanks man! Cool video, helped me a lot!
Thank you very much. This was just what I needed to clean up my merge requests
You are a genius!! This video has helped me a lot
This is such a helpful resource! :)
Perfect video, short, precise with visualization. Not like telling the history of git for 40 minutes, and then start explaining things like others do
Very clear explanation, thanks !
The animation is what is required to understand Git commands...thanks for making the effort to make them to explain....please make more videos on Git
Excellent tutorial.
Superb Explanation
A perfect video. Thank you 🙂
Thank you for saving my life!
Great Explanation. Thank You.
Great video,solved so many doubts
Thank you very much for your content. Extremely helpful
You explained it beautifully
Thank you very much for your knowledge sharing, you're the best!
very helpful and short video. short time you teach me alot.
thank you !
Amazing video man, THANKS A LOT
omg this video saved my life, thank you very much!!!
Thanks a lot for this video, this is very useful
excelent vídeo. very clear explained. that kind of graphics are a very good idea.
i fixed something today by manual merging with dev branch if i knew this before i wouldnt need to do manual work. Thanks man nice videos
Love your videos! I hope you go ahead with them!
For sure. Got any idea for topics?
@@themoderncoder Soft Skills. They are as much crucial as Hard Skills. The idea is to present the most important of them, and how can Soft Skills turn you into a rare professional.
thanks man . you saved my day
crazy vid man, thanks
Awesome tutorial. Learnt new things. Cheers (y)
Thank you, very good tutorial.
So useful! Thank you so much
great great tutorial videos. you are brilliant
Holy shit, git rebase is powerful.
I will keep this in mind whenever I want to fix something in my git history.
Thanks for this! If you stick to Vim as the default Git text editor, you may want to know about the following commands as a starting point:
gg → Go to top of buffer/file.
ddp → Delete a line and put it below the current one (to re-order commit). `dd` deletes a line while `p` put it below the current line.
ddkP → Delete a line and put it above the current one. `dd` deletes a line, `k` moves up one line and `P` (uppercase) pastes above the current line.
h / j / k / l → Move around à la Vim.
x → Delete a character
xp → Switch the order of two characters.
G → Go to the end of the buffer/file.
ZZ → Save and quit buffer. For this purpose, same as `:wq` but less keystrokes ;).
There's obviously much more to learn, but that should be useful to at least do some basic operations.
Also, when splitting a commit, a single file might be part of two commits. So to commit only part of a file, there's also an interactive staging mode: git-scm.com/book/en/v2/Git-Tools-Interactive-Staging
Great comment but I'm surprised you didn't include 'dw'. No one should be backspacing a word in Vim
@@SomeUA-camGuy I thought a similar thing, but would recommend 'cw' (change word) instead, which enters you into insert mode after deleting the word. So it is equivalent to 'dw' + 'i'
@@joshuakoehler6457 It would seem you know a tiny bit more Vim than I.
that was rly helpful thank you
Clearly and easy to understand. thank for good video. :-)
Hidden gems of youtube.
Excellent, Very helpful. Thanks
You r underrated bro...keep making videos