Git rebase tutorial. Rebase vs Merge

Поделиться
HTML-код
  • Опубликовано: 18 ноя 2024

Комментарии • 65

  • @rahulsood81
    @rahulsood81 2 года назад +1

    I love this guy !
    git Rebase: done and dusted. Thanks to this Guy.

  • @PrateekKapoormsa
    @PrateekKapoormsa 3 года назад +4

    Thanks, bother, your diagrams/animations were a great help, without them it would have been difficult to get it

  • @ruixue6955
    @ruixue6955 4 года назад +11

    1:15 git rebase
    4:28 diagram
    6:24 git reflog

  • @youssefdirani
    @youssefdirani 4 года назад +2

    Essence of the video is here 4:24. Thanks I really learnt something.

  • @neithanm
    @neithanm 2 года назад +2

    Hey mate! Where are you? Just discovered your channel, awesome material. I hope you can continue with more! 💪

    • @Ihatetomatoes
      @Ihatetomatoes  2 года назад +1

      Hey mate, not having enough spare time to create more content, great to hear that you find my videos useful. I will be back one day😂

  • @FunnyFenix
    @FunnyFenix 2 года назад

    best explanation on youtube

  • @kevinlao3690
    @kevinlao3690 3 года назад +3

    Thanks for the video. I always had a rough understanding of git rebase vs git merge, but I was never taught when would be a good idea to use it for each use case.

  • @daniellaerachannel
    @daniellaerachannel 4 года назад +4

    excellent Petr! I use rebase quiet often since I work as a fullstack

    • @Ihatetomatoes
      @Ihatetomatoes  4 года назад +2

      Thanks Daniel. Have you had any issues with rebase? Or do you have any tips on rebase? When to use and when not?

    • @daniellaerachannel
      @daniellaerachannel 4 года назад +3

      @@Ihatetomatoes ok, this is my flow when I am on a feature/
      git status (up to date),
      gitk --all (to check eventually the level of commit done on my branch),
      git checkout develop -> git pull (to update my local develop), git merge if conflict then push eventually,
      git checkout feature/
      now imports all changes from develop -> feature/,
      git rebase develop and resolve conflict if present,
      gitk --all (verify the order of commit),
      the trick I use: git push -f (force) and not pull, that way the commit are ordered as You well explained in your videos,
      it's time to merge my branch so verify the branch is up to date,
      then checkout develop again,
      git merge feature/ (normally now the commit and the history are well ordered and everything works correctly),
      verify gitk --all (to check the feature and develop remote and locally are at the same level)

    • @Ihatetomatoes
      @Ihatetomatoes  4 года назад +1

      @@daniellaerachannel greeat to hear your workflow, very usefule for anyone going through these comments, really appreciate it.

  • @10SURA
    @10SURA 11 месяцев назад

    Thanks for the informative video. What would happen if there is merge conflict and how the commit history will look like in that scenario ? Can you please post some video on this scenario ?

  • @Kayne1b
    @Kayne1b 3 года назад

    I don't hate tomatoes, but your channel name and icon are hilarious.

  • @jaxparrow1794
    @jaxparrow1794 2 года назад +2

    Sir, this was amazing!
    Thank you!

  • @nodezera.a7
    @nodezera.a7 2 года назад +1

    as you can imagine, you are a life-saver lol. Thank you for the explanation!

    • @Ihatetomatoes
      @Ihatetomatoes  2 года назад +1

      Thanks Luiz, happy to save your life 🤣

  • @dvirhanum9530
    @dvirhanum9530 2 года назад +3

    Thanks for the explanation.
    I prefer to use squash and merge most of the time since it allows to revert one commit in case of problem instead of reverting 20 commits if you use rebase. Moreover if you use merge without squash it is even harder. If you are following semantic release using the commits name, then it a lot reasonable to use squash since you want to version your product based on the commit names, fix, feat, !breaking changes. I think rebase can be nice thing when the order of commits is matter to you, or when you want to merge release branch to master and develop. I can't really think about a way that I would really want to use rebase instead of squash and merge. I would be glad if you will give me a scenario that I would need the rebase instead.
    The thing that nice here is the interactive mode, that you can change the commit names and make it more friendly, but other than that, I can't really find a real advantage.

  • @obioranwachukwu9560
    @obioranwachukwu9560 3 года назад +1

    ur examples, was helpful God bless u

  • @Aragorn34KI
    @Aragorn34KI 3 года назад +2

    Thanks for the nice explanation of git merge vs git rebase

  • @mansourcodes
    @mansourcodes 2 года назад

    I would like to thanks u brother, I have a full day trying to solve this lol

  • @iamdedlok
    @iamdedlok 4 года назад +2

    Thanks for the video! That made understanding the basics of rebase easy and quick!

  • @raghubirsingh1276
    @raghubirsingh1276 3 года назад +1

    Thank you. It is really a very helpful video to on Git rebase.

  • @ChessFlix
    @ChessFlix 2 года назад +3

    Hi, great video! Would you mind mentioning what extension you're using to display the branch data in your terminal like that, just to the left of your cursor prompt? Thanks.

  • @ArmenManukyan
    @ArmenManukyan 3 года назад +1

    If by 'my-branch' you mean the master branch, and judging from the diagram that is the case I think it's better to switch to 'his-branch' and do git rebase my-branch. Then when we switch back to 'my-branch' and do the rebase against 'his-branch' we'll have the incoming commits atop of ours and no rewrite of the commit IDs that we care about will occur. Source: ruclips.net/video/f1wnYdLEpgI/видео.html

  • @YoelBenitezFonseca
    @YoelBenitezFonseca 2 года назад

    Nicely explained, thank you

  • @TheMsnitish
    @TheMsnitish 4 года назад +4

    How do you configure the terminal in vscode to colors like that ?

    • @QuantumPhysics4u
      @QuantumPhysics4u 3 года назад +1

      It looks like the zsh agnoster theme. Install that and you'll get the fancy looking terminal. If you're looking to change the colours on ur vscode on mac you can get a hacky solution (I just did this this morning) by adding the following lines to settings.json (if you don't have the iterm terminal then u can delete the linuxExec and osxExec lines):
      "terminal.integrated.fontFamily": "MesloLGS NF",
      "terminal.external.linuxExec": "iterm",
      "terminal.external.osxExec": "Iterm.app",
      "workbench.colorCustomizations": {
      "terminal.ansiBlue": "#ADADAD",
      "terminal.ansiBlack": "#424242",
      "terminal.ansiGreen": "#00c5c7"
      },

  • @mvikash91c
    @mvikash91c 3 года назад +1

    Thank you, the explanation was precise and easy to understand.

  • @shanmugakesavan1918
    @shanmugakesavan1918 3 года назад

    Useful video. Got good understanding about Git Rebase. Thank you.

  • @rajeevsai91
    @rajeevsai91 2 года назад

    Thanks for sharing this video. It's definitely helpful!

  • @erikawwad7653
    @erikawwad7653 3 года назад

    +1 for my battle against the git wizards

  • @prakharshukla2096
    @prakharshukla2096 4 года назад +2

    thankyou so much this helped me out a lot

  • @CDRGH0ST
    @CDRGH0ST 3 года назад

    Which plugin is this that you use showing branch names in vscode terminal?

  • @dylanm7638
    @dylanm7638 3 года назад +1

    well explanation , thank you sir

  • @vancouverhp90
    @vancouverhp90 3 года назад

    Great tutorial Sir XD !!!!

  • @sajzvlog7495
    @sajzvlog7495 4 года назад

    After giving git log how to get out of it. I'm closing terminal to write the next commands. Thanks

  • @MilMike
    @MilMike 2 года назад

    hi! thanks for the video. Can you tell me which software are you using for the animations?? I need to visualize something for my job and it would be cool to add a little bit of life into it.

  • @IrregularPineapples
    @IrregularPineapples 3 года назад +1

    great stuff~ very helpful

  • @joelchacon9278
    @joelchacon9278 3 года назад

    good stuff brother!

  • @wesNeill
    @wesNeill 3 года назад

    I am not afraid of rebase now... But my boss wants me to squash too, and the fear is strong again.

    • @obioranwachukwu9560
      @obioranwachukwu9560 3 года назад

      same as me, even if am to rebase i will never do it on my main.

  • @kinzliu2045
    @kinzliu2045 2 года назад

    Thanks a lot! It is good

  • @datasciencewithglenwrightc9276
    @datasciencewithglenwrightc9276 4 года назад +1

    Great video - thank you!

  • @captainhomeadvantage8960
    @captainhomeadvantage8960 3 года назад

    I did exactly what you explained: git rebase -i ColeagueBranchName but I got the Fatal: Needed a single revision. Invalid Upstream Error. What could be wrong ?

    • @obioranwachukwu9560
      @obioranwachukwu9560 3 года назад

      u typed the wrong branch thats why. example assuming u created a new branch named it (obi) while urs is (main) to rebase then first switch to main by typing $git checkout main
      to rebase use below command
      $git rebase obi
      Note: remember I used main to give u a reference and its not good to rebase ur public branch, which is main u can create more than one branch and rebase in that branch.
      I started learning git 20days ago and i think i have made some litttle progress, we can be friends.
      am in chapter 3.6 Git Branch Rebase. i was confused so i have to look for video tutorial that explains that very well. though i still prefer git merge because this wont override ur work, it will only copy what i did not have to ur main.
      though having good understanding how rebase works is good, because i will still need it in the future.
      my instagram id is @mathewtechhub am also on discord too

  • @jamesguo222
    @jamesguo222 4 года назад +1

    Awesome video, does it mean I should never branch off another branch?

    • @Ihatetomatoes
      @Ihatetomatoes  4 года назад +1

      You can branch of another branch but if that branch is rebased you will have some issues. I recommend using rebasing only on your local branches that are not publicly pushed remote.

  • @muhammadshoaibsikander5148
    @muhammadshoaibsikander5148 3 года назад

    Superb

  • @pinikmanob7335
    @pinikmanob7335 3 года назад

    Haha listened to this on double speed

  • @muratasarslan2359
    @muratasarslan2359 4 года назад

    Very well, thank you. Can you please put a video on "squashing commits while rebasing" ?

    • @Ihatetomatoes
      @Ihatetomatoes  4 года назад +2

      Yes I can, it is coming up soon :) anything else?

  • @mikesacks2913
    @mikesacks2913 3 года назад

    Thank you, I will now destroy a tomato!

  • @delita0057
    @delita0057 3 года назад

    im here.. bcasue im confused

  • @x.huiz.1409
    @x.huiz.1409 2 года назад

    you look like bill burr ngl

  • @joeygarcia7826
    @joeygarcia7826 3 года назад

    This video's example is so simple, non-real world that it was not helpful. If you are going to go through the trouble of making a How To video, don't cut corners. Sheesh!

  • @aimenkara213
    @aimenkara213 2 года назад

    I hate tomatoes too
    what are the odds

  • @igotbit9454
    @igotbit9454 2 года назад

    u hate tomatoes? so no pizza?
    oof.

    • @Ihatetomatoes
      @Ihatetomatoes  2 года назад

      Pizza is great, just not with fresh tomatoes 😂

  • @idontwhy3132
    @idontwhy3132 Год назад

    you look like a skinny bill burr