Duration 4:34

Git MERGE vs REBASE: Everything You Need to Know

168 870 watched
0
7.5 K
Published 10 Aug 2023

Get a Free System Design PDF with 158 pages by subscribing to our weekly newsletter: https://bytebytego.ck.page/subscribe Animation tools: Adobe Illustrator and After Effects. Checkout our bestselling System Design Interview books: Volume 1: https://amzn.to/3Ou7gkd Volume 2: https://amzn.to/3HqGozy The digital version of System Design Interview books: https://bit.ly/3mlDSk9 ABOUT US: Covering topics and trends in large-scale system design, from the authors of the best-selling System Design Interview series.

Category

Show more

Comments - 227
  • @
    @Haitaish9 months ago 2 minutes into the video and animations help understand rebase 10x better than any static explanation on any website ever could.
    thank you.
    488
  • @
    @AlbertLeng8 months ago One of the best channels to learn about sw technologies. No fluff talks, no distracting music, no ads, pure substance with straight to the point explanations and amazing animation! 59
  • @
    @sperrfeuer41587 months ago There' s a reason merging squash commits is so popular, and that' s because it' s the easiest and most compatible with how most people use git. . ...Expand 93
  • @
    @AlexandruPatranescu9 months ago Tried various strategies and so far i prefer to always work with merge commits and almost no rebase (unless the branch was never published)
    merge merge from feature branches to master when ready, no squash, no fast forward, always creating a merge commit.
    i don' t find the history messy as it' s exactly as development happened.
    remember that you can always see history with -first-parent if you want to see only a commit (similar with how squash result can be viewed)
    .
    ...Expand
    38
  • @
    @hello_world_zz9 months ago Alex, you truly are the epitome of excellence. With my 15 you as a swe, i can confidently say that collaborating with someone of your calibre has undoubtedly been the utmost highlight in my professional journey. 7
  • @
    @Furki4_49 months ago I' ve never used rebase and squash techniques but i like the way they combine the commits in the feature branches to the main branch. Thank you. 4
  • @
    @Dmittry9 months ago We squashour personal prs and mergeour team branch to main. To update my branches i prefer rebase. But rebase is not so good if several people work on the same branch. 90
  • @
    @tushar81339 months ago Believe me, you always make us clear long due complex topics in a single shot. I have been trying to figure out this topic for the past few years, but never understood. Thanks a lot! We your channel. 1
  • @
    @eleet3214 months ago Absolutely love the visual way that you taught this, it' s crystal clear. Thank you!
  • @
    @jmwild19 months ago This is a great visual summary of each. I was always skeptical of using rebase and always merged with local commits before pushing my changes. But i think . ...Expand 10
  • @
    @MrZiyak999 months ago I used to rebase the main branch into my feature branch. The issue with that which not many talk about is that if you' re too many commits behind you' ll . ...Expand 6
  • @
    @esra_erimez8 months ago These animations really facilitate the meaning of these concept in a clear and concise manner. Thank you.
  • @
    @sjadev6 months ago By far the best explanation i' ve seen on this topic.
  • @
    @mhopado9 months ago My workflow
    1. Create a feature branch.
    2. Keep pulling and rebasing the changes from the main branch cmd: git pull - rebase
    3. 4. Merge the features branch into main. ...Expand
    3
  • @
    @enistoteles8 months ago Sir, your videos are just perfect. Keep the good work up, cant have enough of it. 1
  • @
    @DanelonNicolas9 months ago I love to update my branches and the merge them to master using squash haha. I love this channel. My new favourite of this year haha. 1
  • @
    @aaraz1016 months ago This guy graphics is always the best to understand and remember, thanks man!
  • @
    @alexeibrinza27199 months ago I prefer the hybrid approach. First create a new feature branch from main branch. Add a few commits on feature branch. If the commits all belong to the . ...Expand 6
  • @
    @saravanansomu82968 months ago This is amazingly simple and precise explanation. Thank you sahn lam.
  • @
    @Sranju238 months ago Thank you, for covering the topic that always gives me little anxiety while executing those commands. 1
  • @
    @michaelvilain84573 months ago Thanks for this. It explained the details of these three features exquisitely.
  • @
    @swedishpsychopath87956 months ago This guys explanation wasn' t too bad, i guess. Thank you! 2
  • @
    @nampt9919 months ago I love your channel sooo much. Thanks a lot with my all grateful. Your video untied the huge knot in my brain. Thanks again! I will always be your big fan!
  • @
    @teeesen5 months ago What a great video! Here is why i ask my team to avoid rebases and squashes. Sometimes i look back at the history for dead ends, i. E. Commits with no descendants. . ...Expand
  • @
    @julienwickramatunga73389 months ago Very nice video, short and insightful!
    thank you for reminding us that as anything in it (and in life really) choosing a git strategy is about no strategy is better than another, there just tools for teams to use, to get the job done.
    have a nice day!
    .
    ...Expand
  • @
    @Clem.E9 months ago With git rebase, i find myself rebasing more often on the main branch in order to prevent the branch from diverging to much. It has the benefit of avoiding too many conflicts on the final rebase. 2
  • @
    @emekaokezie42519 months ago Updating my main branch, i prefer working with git merge. It feels a lot morefor me more importantly is the fact that i can track my commit history when i make use of the merge option. 5
  • @
    @FloBee105 months ago I' ve used merge only. Glad to learn about rebase!
  • @
    @srm33785 months ago Thank you so much! Subscribing faster than i ever have for any channel.
  • @
    @premkatta11284 months ago Clear and straight to the point explanation and animations made concept very much easier to understand. Thanks! And subscribed!
  • @
    @zillboy4 months ago I have used " git merge & squash" rebase sounds good. I' m gonna learn and do that. Thanks for explanation.
  • @
    @truchuynh2119 months ago Very details! Thanks so much for helping the community understand more. I usually use squash commit to add the featured branch to the main after testing the new component on the featured brand.
  • @
    @orterves9 months ago Rebase and mergemerge" not fast forward! Is superior for cleaner change information. I call it theafter rebasing but before merging, i frequently reset soft and selectively commit the files in sets with messages that best describe what was done, in way that ensures each commit builds on the last. Sometimes it' s necessary to commit partial file changes or even adjust the changes directly to better express a
    you can always compare the resulting refactoring with the original rebased branch head commit to confirm the sum total is the same, so there' s no risk of losing changes with this approach.
    what you end up with is clean, readable sets of delineated commits that are useful for future investigation into the history of changes - while still allowing the development process to be continuously committing to a branch without too much concern for the messages or presentation of the commits. It' s a nice have your cake and eat it too approach
    .
    ...Expand
    1
  • @
    @vamsibalaga70579 months ago Great pictorial explanation. Kudos to the idea.
    thank you.
  • @
    @user-ch8sh7ki5d9 months ago Dude you rules, i like all your videos! Thank you for your input )
  • @
    @gusromul33566 months ago Good job bbg! Nice and simple explanation. Ill certainly check your other work.
  • @
    @ashwin_mahajan8 months ago Love your content, cool graphics to help understand.
  • @
    @robertjif63379 months ago I can finally understand what rebase really does thanks man.
  • @
    @MrGreg5579 months ago Great video. It' s also good to note that git rebase is a form of rewriting history. This means that it should be used much more carefully when you . ...Expand 1
  • @
    @the_alien2934 months ago We need complete git playlist like this.
  • @
    @VincentJenks6 months ago Ah, the great debate. Ive hunkered around many a whiteboard and heard endless iterations of passionate arguments for all approaches. Regardless of what y . ...Expand
  • @
    @joecox99583 months ago Very nice and clear, voice also very clear, thanks!
  • @
    @funkynerd_com9 months ago I' m probably doing it wrong, but there' s two projects i work on and do it differently on each. One project is with a small team of 3 developers . ...Expand 1
  • @
    @amandasimonds97 months ago Thank you. I learned something new today.
  • @
    @kingsleyzuze99499 months ago I basically just use git merge, but i think i' ll try git squash more as i sometimes have multiple branches feeding into main - thank you for this one. 1
  • @
    @GrzesiuG449 months ago For me rebasing works great in open source like enviornment, where focus and review is on the changes contributed. In enviornment where many people work . ...Expand
  • @
    @zahidshabbir13858 months ago This youtube tutorial excellently clarifies the git dilemma between merge and rebase, offering concise insights for confident version control choices. can you please share name of video editing software you' re using. Thanks. ...Expand
  • @
    @nayan.j9 months ago All these fuss about rebase and a detailed and precise 5min video cleared that up for me. Thanks.
  • @
    @stpaquet9 months ago Squash is my main go to at the moment. Though from time to time i use the merge approach.
  • @
    @pavankumard52765 months ago Really good tutorial wish there was an example to show the git commands for the following.
  • @
    @iHariPatel9 months ago I been using merge only, now i understood rebase is good idea for clean history. 1
  • @
    @RishabKapadia6 months ago This should be default way to explain git. Too good.
  • @
    @frederik_hd8 months ago When there is a merge conflict i usually rebase my feature branch - and after development i create a pr with an clean and clear git history means combining . ...Expand 1
  • @
    @filipstojiljkovic47118 months ago Excellent video, however i feel like squash is not in the same category as rebase and merge (which video may confuse people of being so) its more of a . ...Expand
  • @
    @ericcartmansh9 months ago This is such a cool, useful and beautiful video.
  • @
    @minlaxz8 months ago I used both, merge and rebase.
    sometimes, it' s better to leave a history (merge commit) since it' s easier to be tracked.
    but sometimes, . ...Expand
  • @
    @Primalmoon9 months ago Working in a large monorepo, rebasing and squashing is essentially required. Without it the branch history quickly becomes a tangled mess, as you end id="hidden27" up with many more merge commits than actual code commits, and then the rest of the commits are a few thousand commits from one developer that was following the tdd practice of making a new commit every time the tests were passing. As long as you can convince people to squash the history can remain readable. And rebasing helps keep the amount of catastrophic merge conflicts to a minimum by not squashing in the same commits that someone else is merging, which will be happening all the time in an active repo. ...Expand 1
  • @
    @adarshchacko61375 months ago sums it up and it does come in handy. Thank you @ByteByeGo
  • @
    @francescoleto28239 months ago Squash feature branch is my preferred option, it guarantees a cleaner history.
  • @
    @amboojmittal29939 months ago Nice video. Git rebase seems good option. I use git merge a lot.
  • @
    @jorden1239 months ago Rebase whenever you want to get your feature branch in sync with main, when done implementing - squash, tag and merge into main.
  • @
    @stephenreaves32059 months ago Feature branches are rebased from main at least daily, generally only squash commits if there' s like 10+ commits per feature branch, then merge onto main.
  • @
    @Oda39088 months ago Main -gt; feature = rebase
    feature -gt; main = squash + merge
    rebase would be painful if the feature branch existed too long, you need . ...Expand 7
  • @
    @BhaveshAgarwal8 months ago Bytebytego - please share the tools and softwares you use to create these wonderful videos. It will be extremely helpful to learn them and use it for work and share knowledge in general. Thanks in advance!
  • @
    @mestlabs99227 months ago I really love your videos. I have subscribed to bytebytego and continue to learn from the content you share. I have one question about your video animation. . ...Expand
  • @
    @joecox99583 months ago Hope you get one for git graph with clear statement for a simple git process flow: pull, checkout, merge, push, and associated with the graph change.
  • @
    @shubhamgawali80303 months ago While developing a changes on local i prefer git rebase and after creating a pr i merge the feature branch to master.
  • @
    @RajinderYadav3 months ago I' ve always have rebase mess up, and then trying to back out is a major pain. I understand how it works, but i somehow always have it blow up in my . ...Expand
  • @
    @thatGeorgeR9 months ago It would be good to touch problems that git rebase may lead to. Not every one aware about a pitfalls that you may face using git rebase unthoughtful. Good video by the way.
  • @
    @aishasuleman28828 months ago Nice video
    what software do you use to create the animated presentation?
  • @
    @seekinginfo9 months ago Which tool is used to make these nice visualizations and diagrams. Would appreciate the input.
  • @
    @reza_majidi8 months ago I personally use rebase before merging my feature branch to staging. In this way every merge conflicts will be resolved in my branch before merge. I also occasionally rebase to staging to get the latest changes. 1
  • @
    @withpratap8 months ago How to create such visuals? Any tools you used can you recommend any?
  • @
    @zshn9 months ago Git rebase is a nightmare in a large team working on same files. Developers spent time resolving conflict on their local and then in production. Without . ...Expand
  • @
    @MichaelScharf9 months ago I use rebase to squash 20-50 small commits on my feature branch into a few meaningful ones before merging. I typically commit up to 10 times an hour. 1
  • @
    @harinathxxx8 months ago I have used git merge which will be easy to maintain and add to bug fix.
  • @
    @thomasluk43199 months ago I would want to know more abnoout squash, for the git command, should i use rebase -i?
  • @
    @balsu796 months ago What tool you use for the animations - it' s cool.