How to squash and rebase in git

Sdílet
Vložit
  • čas přidán 10. 09. 2021
  • Git rebase is a handy tool to have for creating nice clean history in your git repository. Come on in to see how it works and how it can help you clean up your commit history.
    Level Up
    Data Structures & Algorithms
    www.udemy.com/course/the-swif...
    Level Up AutoLayout
    www.udemy.com/course/level-up...
    Level Up in Swift
    www.udemy.com/course/level-up...
    Twitter
    @jrasmusson
  • Věda a technologie

Komentáře • 26

  • @limonatamber
    @limonatamber Před 11 měsíci +1

    Thank you!!! A lot of people say ":wq", but they didn't mention press "esc" before that !!!! That's why I found your video!
    Save my day!

  • @fiendgrin
    @fiendgrin Před 6 měsíci

    ngl, the only video that actually helped me understand squash, and taught me how to use it

  • @user-em9js9el5g
    @user-em9js9el5g Před 3 měsíci

    Happy to see howard from better call saul is doing good and switched careers to software engineering .

  • @indracahyadi4757
    @indracahyadi4757 Před 8 měsíci

    Very nice tutorial! 🎉

  • @DebugWithAdam
    @DebugWithAdam Před rokem

    Superb, in a short video, I learned a lot ;)

  • @GorillaDev417
    @GorillaDev417 Před 2 lety

    Awesome video man! Definitely going to start using this!

  • @janvikalra6490
    @janvikalra6490 Před rokem

    super helpful! thanks a bunch

  • @andonidasilvaotero9652

    Good and simple tutorial. Thanks Jonathan

  • @abymathew575
    @abymathew575 Před 2 lety

    you are really a great teacher

  • @dylanngo4454
    @dylanngo4454 Před 4 měsíci

    Thank you so much bro :))

  • @romancebula1263
    @romancebula1263 Před 2 lety

    And once again your video helped me a lot …. I was struggling with this editor and now I know how to deal with it:)
    Thanks again 🍺🍺

    • @swiftarcade7632
      @swiftarcade7632  Před 2 lety

      You are not the only one. It definitely takes some getting used to. Most welcome 🚀.

  • @rachelemsley5972
    @rachelemsley5972 Před 2 lety +1

    Use the fixup option if you don't want the commit messages for the commits you're squashing

    • @swiftarcade7632
      @swiftarcade7632  Před 2 lety +2

      No way - I didn't even know you could do that. Trying now. Thanks Rachel!

  • @lokeshios927
    @lokeshios927 Před 2 lety

    Nice One... Please Do video on difference between merge and rebase

    • @swiftarcade7632
      @swiftarcade7632  Před 2 lety +1

      Thanks for the suggestion Lokesh. Merge just merges two branches together respecting the history. Rebase just replays your changes on top of the branch you rebase too. I prefer rebase, because that way I never mess up the branch I am merging too (any conflicts are my own). But I have heard others say they like merge for reason (though I am not sure why). Some googling will no doubt better explain the differences. That's my best explanation for now. Cheers and thank you for asking. Will see if I can create a video one day because it is a popular question.

  •  Před 2 lety

    Thanks for the handy commands Jonathan. Would be great if you could make a video about mirror a huge git repo. Let's say we have a huge git log history, as well the source code size. But new repository has a size limitation. So, what I would like to do, push only last a few commits to the new repo. I'll keep my original repo in origin, but mirror the new repo for less commits.
    I just noticed that whenever I want to sync repos, do I have to take care of push commit (always commit after the last commit). I assume this command will push whole history `git push mirror master`
    Or what is the best practice to reduce the size of log history (one way is squash yes but doing that will also take time), also in the past accidentally they have submitted SDKs source codes into the repo where it is root cause of the huge size...

    • @swiftarcade7632
      @swiftarcade7632  Před 2 lety +1

      Hi Nesim. Once option for reducing the size of a huge repos is to just create a new repos, copying the latest version in there, and then starting all over. Yes you lose the history, but if you don't really care it can greatly reduce the size of your repos - by starting fresh. All the best!

    •  Před 2 lety

      @@swiftarcade7632 Thank you very much for your kind reply. Yes, will go that way as it is temporary.

    • @swiftarcade7632
      @swiftarcade7632  Před 2 lety +1

      @ No problem. And good luck!

  • @swoleavocado
    @swoleavocado Před 2 lety

    So you're not supposed to use --force ?! ...

  • @familyshare3724
    @familyshare3724 Před rokem

    cwsquash
    . to repeat