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-...

КОМЕНТАРІ • 263

  • @themoderncoder
    @themoderncoder  Рік тому +1

    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/

  • @tomng92
    @tomng92 3 роки тому +59

    Pure gold! Learnt faster in those 12 mins than reading any book.

  • @RedFenceAnime
    @RedFenceAnime 3 роки тому +61

    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

  • @AdamTheBen
    @AdamTheBen 4 роки тому

    Thank you very much for your content. Extremely helpful. Love the animations, they make it so easy to wrap your head around the concepts.

  • @nikolajovanovic1140
    @nikolajovanovic1140 4 роки тому +2

    Concise and straight to the point.
    Bravo!

  • @losrobbosful
    @losrobbosful 4 роки тому +25

    This was gold, helped me a lot. Definitely great teaching abilities.

  • @danielwestberg9540
    @danielwestberg9540 4 роки тому

    Very well explained! Super good with the visual branches to better understand what's happening

  • @786saga
    @786saga 4 роки тому +5

    Dude it really helped me a lot i was missing the few of these concepts of git thank you.

  • @zmark2274
    @zmark2274 3 роки тому +1

    Can't express how thankful I am to you. So accurate and informative. Thank you indeed

  • @die1234abc
    @die1234abc 3 роки тому

    Best explanatory video on all this subjects! Thanks and keep up the good work!

  • @cddrury
    @cddrury 4 роки тому +2

    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!

  • @codewithsub5083
    @codewithsub5083 4 роки тому +1

    This is the best tutorial of git I have ever seen.
    Thanks man

  • @fahadmubeen6272
    @fahadmubeen6272 3 роки тому

    Really like the video, and the written blog is good too. Clear, concise and to the point.

  •  5 років тому +1

    Omg did not know that is possible to reording commits. So darn simple! Thank you!

  • @nrmlkmrks
    @nrmlkmrks 4 роки тому

    Awesome video! Great example of explaining stuff to the point with really good examples.

  • @pascualrosario8633
    @pascualrosario8633 11 місяців тому

    You have a gift for teaching. Very concise and easy to understand.

  • @sebastianfarias5670
    @sebastianfarias5670 3 роки тому

    Simply the best GIT explanation ever, super concise and really helped me get out of a pickle today !!! THANK YOU !

  • @najimali32
    @najimali32 2 роки тому

    Your Git Videos are really helping me to play with my commits & branch at work. Thank you so much.

  • @greenmanreddog
    @greenmanreddog 4 роки тому

    Very clear and concise explanations - thanks.

  • @Anujgupta-yi9di
    @Anujgupta-yi9di 3 роки тому

    Great job! Explains everything so easily :)

  • @peterdoyle1994
    @peterdoyle1994 3 роки тому

    Best, clearest git tutorials by a country mile. Thanks.

  • @MartijnMuijsers
    @MartijnMuijsers 2 роки тому +1

    Great concise explanation of everything that might matter to someone!

  • @sumanghosh4439
    @sumanghosh4439 2 роки тому

    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.

  • @thesavagesalmon9464
    @thesavagesalmon9464 4 роки тому +6

    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!

  • @bseroy
    @bseroy 4 роки тому +1

    These videos are fantastic!

  • @gabrielsoloman5000
    @gabrielsoloman5000 4 роки тому

    best series on non-basic git, congrats

  • @AIGenerated
    @AIGenerated 4 роки тому

    Good job this video looks edited by a professional company, the animations really help, keep up the good work

  • @ianedits1
    @ianedits1 2 роки тому

    Short and precise. Good job sir

  • @zmark2274
    @zmark2274 3 роки тому

    Over and over hank you again to express yourself in so clear way

  • @darkphoenix68
    @darkphoenix68 14 днів тому

    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! 🙂

  • @videet
    @videet Рік тому

    Clear and crisp. Thank you.

  • @RubenDias93
    @RubenDias93 4 роки тому

    Great tutorial! Very useful and nicely explained.

  • @d-e-v-esh
    @d-e-v-esh 3 роки тому

    This is the best video by far I have seen on UA-cam. Thank you so much man....

  • @donalexey
    @donalexey 5 років тому +9

    This is just a great tutorial!

  • @Trhnetesiuz
    @Trhnetesiuz 2 роки тому

    3 hours of other videos in 13 minutes. Awesome. Thanks a lot

  • @JoshuaMusau
    @JoshuaMusau 4 роки тому +1

    You make a really good teacher...

  • @arthurh2064
    @arthurh2064 4 роки тому +1

    I wish you wouldn't have stopped uploading git tutorials, they are by far the best I've seen and I've seen many

  • @gabrielsanmartin8326
    @gabrielsanmartin8326 3 роки тому

    Awesome buddy! I'm trying to go deep into git.. and this video was gold.

  • @louaiforui
    @louaiforui Рік тому

    Great job! great explanation!

  • @NirdeshM
    @NirdeshM 3 роки тому +1

    Very informative with awesome explanation.

  • @Kamaltweet
    @Kamaltweet 4 роки тому

    Wow. You made it so easy to learn. Thank you 🙏

  • @shivanjalikaname8935
    @shivanjalikaname8935 3 роки тому

    Voila...you gained a subscriber.. just loved the way you explain technically and practically

  • @qCJLbggG4IWAY9nTH6o
    @qCJLbggG4IWAY9nTH6o 2 роки тому

    I'm thankful for your content

  • @krazee_aznnn
    @krazee_aznnn 4 роки тому

    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!

  • @SakhawatHossainlive
    @SakhawatHossainlive 3 роки тому

    Wonderful !! Thanks for this video man.

  • @przemekostrowski3108
    @przemekostrowski3108 9 місяців тому

    Very good video. Well explained. Thank you!

  • @vishnuthamizharasan6192
    @vishnuthamizharasan6192 4 роки тому

    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

  • @kapaaaau
    @kapaaaau 4 роки тому

    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.

  • @Pumazr
    @Pumazr 4 роки тому

    Great video, so clean explanation.

  • @DavidLance
    @DavidLance 4 роки тому

    Absolute life saver! Thanks a ton for this.

  • @vaibhavgarg5607
    @vaibhavgarg5607 2 місяці тому

    Was stuck on a PR as I was unable to edit a commit's changes this video saved me. Really helpful

  • @nospecialmeaning2
    @nospecialmeaning2 2 роки тому

    Subscribed!
    You might be the only UA-camr I have an occasional compulsion to listen to at lower than normal speed :D

  • @martinspilovsky9071
    @martinspilovsky9071 3 роки тому +1

    Thank you so much for this compilation

  • @SarnenduMukherjee
    @SarnenduMukherjee 3 роки тому

    Thank you for this superb video. Awesome animation and edit makes this video more awesome.

  • @youssefsabbagh4341
    @youssefsabbagh4341 2 роки тому

    Great video !! Couldn't have explained it any better !!

  • @rockydev5750
    @rockydev5750 5 років тому +1

    Amazing Dude!
    Thanks for your video.

  • @siegblink182
    @siegblink182 4 роки тому

    Thanks for making this video. This has solved most of my problems.

  • @abdul-aleemelmuzoghi4133
    @abdul-aleemelmuzoghi4133 3 роки тому

    Been 2 days trying to learn how to delete a commit and you just came and and did it in 2 minutes

  • @alexanderjesusvargas5998
    @alexanderjesusvargas5998 4 роки тому +2

    It is crazy this is free content!

  • @fullstackprojects5615
    @fullstackprojects5615 3 роки тому +1

    git rebase is a very powerful tool. Thanks for sharing your knowledge :)

  • @mr.w7803
    @mr.w7803 4 роки тому

    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!

  • @jeffreyrooks9488
    @jeffreyrooks9488 4 роки тому +1

    Excellent video!

  • @rahuldasmajumder7690
    @rahuldasmajumder7690 2 роки тому

    Thanks man..it really cleared the doubts✌️

  • @pradeepnooney3056
    @pradeepnooney3056 3 роки тому

    Thank you so much. Very good tutorial. and good animation too

  • @magakz
    @magakz 2 роки тому

    Awesomeee!!! Thanks man! Cool video, helped me a lot!

  • @Mark986270
    @Mark986270 8 місяців тому

    Thank you very much. This was just what I needed to clean up my merge requests

  • @rohitkumarshrivastava9693
    @rohitkumarshrivastava9693 3 роки тому

    You are a genius!! This video has helped me a lot

  • @ashleyrawr74
    @ashleyrawr74 4 роки тому

    This is such a helpful resource! :)

  • @gaofan2856
    @gaofan2856 Рік тому

    Perfect video, short, precise with visualization. Not like telling the history of git for 40 minutes, and then start explaining things like others do

  • @violindiep
    @violindiep 4 роки тому

    Very clear explanation, thanks !

  • @alpavaidya412
    @alpavaidya412 4 роки тому

    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

  • @liminal6823
    @liminal6823 2 роки тому

    Excellent tutorial.

  • @vidyawimalasooriya6604
    @vidyawimalasooriya6604 2 роки тому

    Superb Explanation

  • @StefanBanu
    @StefanBanu 4 роки тому +1

    A perfect video. Thank you 🙂

  • @LeonardoBPG
    @LeonardoBPG 4 роки тому +1

    Thank you for saving my life!

  • @samithakulatilaka
    @samithakulatilaka 3 роки тому

    Great Explanation. Thank You.

  • @soumyadrip
    @soumyadrip 3 роки тому

    Great video,solved so many doubts

  • @10SURA
    @10SURA 3 роки тому

    Thank you very much for your content. Extremely helpful

  • @BG-fo4si
    @BG-fo4si Рік тому

    You explained it beautifully

  • @akbarhafeezbutt1761
    @akbarhafeezbutt1761 2 роки тому

    Thank you very much for your knowledge sharing, you're the best!

  • @forkanali
    @forkanali 3 роки тому

    very helpful and short video. short time you teach me alot.
    thank you !

  • @jibaromar2249
    @jibaromar2249 4 роки тому

    Amazing video man, THANKS A LOT

  • @lucasvtiradentes
    @lucasvtiradentes 3 роки тому

    omg this video saved my life, thank you very much!!!

  • @sekar887
    @sekar887 2 роки тому

    Thanks a lot for this video, this is very useful

  • @demian256able
    @demian256able 2 роки тому

    excelent vídeo. very clear explained. that kind of graphics are a very good idea.

  • @VKD007
    @VKD007 2 роки тому

    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

  • @pitter5990
    @pitter5990 5 років тому

    Love your videos! I hope you go ahead with them!

    • @themoderncoder
      @themoderncoder  5 років тому +1

      For sure. Got any idea for topics?

    • @pitter5990
      @pitter5990 5 років тому

      @@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.

  • @amitbd1508
    @amitbd1508 2 роки тому

    thanks man . you saved my day

  • @rodhash
    @rodhash 2 роки тому

    crazy vid man, thanks

  • @mrrajib
    @mrrajib 3 роки тому

    Awesome tutorial. Learnt new things. Cheers (y)

  • @MrSchattka
    @MrSchattka 4 роки тому

    Thank you, very good tutorial.

  • @jingz.9684
    @jingz.9684 5 років тому

    So useful! Thank you so much

  • @jaytran247
    @jaytran247 3 роки тому

    great great tutorial videos. you are brilliant

  • @m4rt_
    @m4rt_ 7 місяців тому +1

    Holy shit, git rebase is powerful.
    I will keep this in mind whenever I want to fix something in my git history.

  • @slavoie
    @slavoie 4 роки тому +8

    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

    • @SomeYouTubeGuy
      @SomeYouTubeGuy 4 роки тому

      Great comment but I'm surprised you didn't include 'dw'. No one should be backspacing a word in Vim

    • @joshuakoehler6457
      @joshuakoehler6457 4 роки тому +1

      @@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'

    • @SomeYouTubeGuy
      @SomeYouTubeGuy 4 роки тому +1

      @@joshuakoehler6457 It would seem you know a tiny bit more Vim than I.

  • @TrevorCS02
    @TrevorCS02 2 роки тому

    that was rly helpful thank you

  • @ratenoopee
    @ratenoopee 4 роки тому

    Clearly and easy to understand. thank for good video. :-)

  • @rabishankar5993
    @rabishankar5993 3 роки тому

    Hidden gems of youtube.

  • @Dipenparmar12
    @Dipenparmar12 4 роки тому

    Excellent, Very helpful. Thanks

  • @mohammadanas3320
    @mohammadanas3320 3 роки тому

    You r underrated bro...keep making videos