git rebase - Why, When & How to fix conflicts

Sdílet
Vložit
  • čas přidán 25. 06. 2024
  • Why, when and how to do git rebase. How to fix merge conflicts during git rebase.
    If you like my style of teaching, I'd love to see you at a workshop!
    philomatics.com/git-workshop/
    Fixing merge conflicts:
    • Never fear merge confl...
    Video on `git pull --rebase`:
    • Never* use git pull
    How to change your default editor in git:
    • 10 useful git aliases
    Use the following command to change your default editor to VSCode:
    git config --global core.editor "code --wait"
    If you use a different editor, just Google "git set text editor to $yourEditor", it's usually easy to find.
    Git Graph Extension for VSCode:
    marketplace.visualstudio.com/...
    If you don't use VSCode, you can also use SourceTree, which is free.
    www.sourcetreeapp.com/
    0:00 - Why rebase?
    1:54 - Squash vs Rebase
    2:11 - How to rebase
    3:22 - Downsides of rebasing
    4:37 - Fixing conflicts
    5:28 - Conflict resolution example
    8:15 - Interactive rebase
    Thank you to Jonas Geiler and Bruno Paulino for giving great feedback on drafts of this video!
    LEGAL DISCLAIMER
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    Everything here is for informational purposes only. All non-licensed clips used for fair use commentary, criticism, and educational purposes. See Hosseinzadeh v. Klein, 276 F.Supp.3d 34 (S.D.N.Y. 2017); Equals Three, LLC v. Jukin Media, Inc., 139 F. Supp. 3d 1094 (C.D. Cal. 2015).
  • Věda a technologie

Komentáře • 130

  • @philomatics
    @philomatics  Před 16 dny +14

    I'm working on a free git cheatsheet that will (hopefully) put all other cheatsheets to shame. It'll have animations like in this video, and will be interactive. If you want to get notified when it's released, please leave your email here: philomatics.com/

    • @AhmedGamal-mm4sp
      @AhmedGamal-mm4sp Před 11 dny

      can you also please make a video that explains everything in the cheatsheet?

    • @philomatics
      @philomatics  Před 10 dny

      @@AhmedGamal-mm4sp Hah, working on it! :D

    • @b213videoz
      @b213videoz Před 7 dny

      I know a guy who, upon having been fired, committed his changes but never pushed them 😁

  • @rascta
    @rascta Před 2 dny +2

    I'll add a tip that you lightly touched on: never rebase on another branch without *first* squashing your branch on itself. That way lies madness.
    Picture this - you've got 20 commits and you're rebasing on main (or whatever) that has several commits. If you get a conflict, that's *not* a conflict between the current state of your branch and the current state of the other. It's a conflict between the state of your branch 20 commits ago, 19 commits ago (plus changes from last conflict resolution), 18 commits ago (plus changes from previous conflict resolutions), etc. So you have to mentally time-travel back in time to fix what the conflicts would've been at each point in time, for each and every commit, including between code that you didn't write back then but modified during previous conflict resolutions. Possibly introducing more conflicts and/or bugs all along the way. In the end, you haven't rebased the current state of your branch on the current state of the other, you've added all kinds of changes along the way. Now you have tons of changes and untested code that you're pushing.
    In a merge commit, *or* if you've squashed your branch into a single commit and *then* rebase, in that case you're only dealing with conflicts between the current state of the two branches. Which is *vastly* easier to wrap your head around and understand and test. No time-traveling needed, no accumulating bugs.
    That of course means that you lose your commit history of how you got here from there, since you only have 1 commit instead of 20. But at least you have your sanity.

    • @philomatics
      @philomatics  Před 2 dny

      This is a great suggestion! I would add that you can at least attempt the rebase once before squashing, and only if you get conflicts, abort it using git rebase --abort, then squash, and then rebase again.
      I explained squashing in detail on my video on interactive rebase.
      git interactive rebase - Undo, Edit & Squash git commits with a single command
      czcams.com/video/42392W7SgnE/video.html

  • @ARKGAMING
    @ARKGAMING Před 15 dny +15

    The first two minutes I was like "our team squashes the commits so the merge commits don't matter"
    But of course you pointed it out as an option

    • @privateagent
      @privateagent Před 9 dny

      Same. Problem with that, you lose track of what you did for 2 weeks while working on a feature

  • @bobDotJS
    @bobDotJS Před 15 dny +11

    I have been doing this for years professionally and just learned about cherry picking.
    Thats why your channel is important. Git education sucks.

  • @streettrialsandstuff
    @streettrialsandstuff Před 13 dny +1

    I'm using rebase for many years now. It's the best way to deal with history and conflicts.

  • @thedelanyo
    @thedelanyo Před 15 dny +12

    This channel is a gold mine. Please keep it up. 😅😅

    • @philomatics
      @philomatics  Před 15 dny

      Thank you for the nice comment, made my day :)

  • @lloyd100
    @lloyd100 Před 15 dny +3

    I need more content like this, it's very useful and it keeps me focused while programming

  • @wadecurry938
    @wadecurry938 Před 11 dny +1

    You tell beginners to switch away from vim!?!? The learning curve is GOOD for ya!! It made me what I am today!

    • @philomatics
      @philomatics  Před 11 dny +3

      "A good beating never hurt anyone" - Albert Einstein

  • @adrians9367
    @adrians9367 Před 14 dny +3

    You explain it so easy
    I hope you keep with this type of git videos 😅

  • @vladislav_artyukhov
    @vladislav_artyukhov Před 11 dny +1

    Beautiful explanation. I haven't found some good guides earliers, and now found perfect

  • @alperari9496
    @alperari9496 Před 15 dny

    Funny that your video was uploaded yesterday and i just today had to do a rebase for my company's project and referred to your video. Thanks!

  • @nandordudas
    @nandordudas Před 15 dny +7

    "never push if" - you can do anything on your branch (rebasing + force pushing, etc.) until any other users not connected or touching your branch

    • @TokyoXtreme
      @TokyoXtreme Před 15 dny

      That's the true golden rule of rebasing. I would add that only use "merge" when two branches should become one - leaving one of them to be permanently discarded. Technically both branches become discarded because they have been "merged" into a new one.
      Otherwise, collaborative feature branches should just cherry-pick any critical code that appears on the main / master branch.

    • @squishy-tomato
      @squishy-tomato Před 15 dny +3

      exactly what I do as well; I don't think we should be discouraging pushing, even at the cost of conflicts.
      Also, --force-with-lease instead of --force resolves the risk of losing work.

    • @TokyoXtreme
      @TokyoXtreme Před 15 dny +1

      @@squishy-tomato To paraphrase The Simpsons: "I'm just going to sit here and push my commits and rebase as I like, and if you get hit, it's your own fault".
      But I do use "with lease" just in case. I don't really consider my feature branch "public" until I've made a pull request or have asked someone to branch off of it and make use of my work. And by that point I'm only cherry-picking anyway, in the rare event I need to pull code from higher up in the flow.

    • @philomatics
      @philomatics  Před 12 dny

      Agreed, for the video I thought I'd rather make the rule a bit more restrictive than not, so people don't mess up their repos accidentally. But yeah, as long as you know that nobody else is pulling/pushing your branch, you're fine.

  • @DK-ox7ze
    @DK-ox7ze Před 13 dny +2

    I have always used git merge and yes it creates a messy history, but I have never found that to be a problem.

  • @CottidaeSEA
    @CottidaeSEA Před 14 dny

    Really good video, it tells exactly why I am hesitant to ever recommend rebasing. I'm glad you mentioned you were working on it in the replies.

  • @TheThirdWorldCitizen
    @TheThirdWorldCitizen Před 13 dny +3

    git pull origin main -rebase gang

  • @stanislavkozak2806
    @stanislavkozak2806 Před 15 dny

    Wow! Such a clear explanation. I should have watched it before I started fighting the Lord of Branches myself. 😅

  • @volodymyr.brodskyi
    @volodymyr.brodskyi Před 16 dny +4

    I like your videos! Really informative!

  • @askolotus_prime
    @askolotus_prime Před 15 dny

    Please make more videos! I'm learning proper git and very interesting in Squash and other best practices

  • @ghun131
    @ghun131 Před 7 dny

    Thank you! Now I know why doing rebase for my remote branch doesn't work. Please explain git merge squash as well!

  • @MsSLOOM77
    @MsSLOOM77 Před 11 dny

    Thanks for sharing this video ❤

  • @user-xt1ko6zv4n
    @user-xt1ko6zv4n Před 16 dny

    great video as always.
    previously i thought, when i have a rebase conflict i should do `git add` , `git commit` .
    i didn't know about `git rebase --continue`. 🤦‍♂
    thank you very much!

    • @sahajmalla
      @sahajmalla Před 14 dny

      If there are no new changes or file added (check by git status) after rebasing, you don't even need to git add --all. You can directly git push --force or --force-with-lease

  • @sahil_singhai
    @sahil_singhai Před 12 dny

    Dude, Respect. Love this video and even my manager 6+ year exp don't know how does rebase work. but I know now. please use more examples like the one you did here, that helps alot to understand better. giving you a subscribe buddy.

  • @shis10
    @shis10 Před 15 dny

    Very helpful video.

  • @emersongabrielrochanobre9319

    great job, you have got a new subscriber

  • @desmontandolaweb
    @desmontandolaweb Před 12 dny

    This.. mate is good stuff!

  • @reinhardlackner1925
    @reinhardlackner1925 Před 12 dny

    my philosophy is like this: feature branches belong to a single developer only. even if a reviewer pulled a PR (so he pulled the feature branch), I would not recommend or allow it that he would go on and work with that (reviewing only is fine though). It it is agreed on, that a branch only belongs to one dev, you only have to do force pushes to origin and you are fine.
    and, if there would be many commits I'd have to go through during the rebase phase, either do a squash beforehand (on your feature branch) or, do a reset with keep local changes just one commit before you started, stash them away, rebase, then re-apply the stash.
    but, in the end, there can only be one (dev) to rule the feature branch so you can be confident to force push to origin after the rebase.

  • @yuxiang4218
    @yuxiang4218 Před 15 dny

    great video !

  • @unskeptable
    @unskeptable Před 11 dny

    Sweet video

  • @residual-entropy
    @residual-entropy Před 15 dny

    Nice video! Would love on one squash-and-merge and how it compares to rebasing. I’ve used both a decent amount but don’t feel like I totally understand the pros/cons/differences. :)

  • @grymmjack
    @grymmjack Před 12 dny

    :D rebasius lord of branches!

  • @AnggiWijaya
    @AnggiWijaya Před 10 dny

    your voice and choices of memes reminds me of @ModestPelican gaming channel 😂 7:07

  • @MikelAingeru
    @MikelAingeru Před 13 dny

    Good explanation, better memes 🤣

  • @VincentOrdioni
    @VincentOrdioni Před 16 dny +16

    The potential mistake with pushed commits is why we don't use git rebase by default instead of git merge at work, unfortunate, this is so much cleaner...

    • @philomatics
      @philomatics  Před 16 dny +8

      Yeah I think there's a lot of fear surrounding rebase, but sometimes it's warranted ;) I think many of us have horror stories of messing up our repos with a rebase ^^

    • @VincentOrdioni
      @VincentOrdioni Před 16 dny +2

      @@philomatics Yeah, it's scary... Great video though, and very good channel in general, keep it up!

    • @greyshopleskin2315
      @greyshopleskin2315 Před 14 dny +5

      Well, for feature branches i dont see much problem.
      You can do before a backup branch either local or remote.
      If you understand rebase and other git commands, theres really no problem. Specially if you know how the reflog works. Everything is reversible.
      But it is true that most people don’t spend a lot of time learning git.
      So it is understandable.
      In my case, I usually work with feature branches where I am the only one commuting, so I do crazy stuff lol.
      When merging to main I do a squash merge because that’s the policy

    • @royler8848
      @royler8848 Před 14 dny +1

      The conclusion we came up to is we almost never have 2 people working on the same branch, and if they need the same WIP code that will both cherry pick it, and then one of them will merge to master and the other will rebase on top of master and discard the cherry picked wip stuff

    • @MrMassaraksh
      @MrMassaraksh Před 13 dny +1

      You can create fresh branch locally. Rebase it and then push to merge

  • @FelipeV3444
    @FelipeV3444 Před 15 dny +1

    Based video

  • @privateagent
    @privateagent Před 9 dny

    I'm genuinely this dude 2:55

  • @rbfndz
    @rbfndz Před 11 dny

    All hail team rebase. Branch history as straight as bamboo 😂

  • @Kitsune_Dev
    @Kitsune_Dev Před 13 dny

    yes, please make a video on Squash merge😊

    • @philomatics
      @philomatics  Před 12 dny

      Thanks, will consider it if there's enough interest :) Got a lot of other stuff already planned, stay tuned!

  • @69k_gold
    @69k_gold Před 12 dny

    Rebase is cleaner, at the cost of lost information, having two parent commits isn't a bad thing, atleast that way we can pinpoint the exact point of merge without needing to read 10k commits

  • @tobiasj8019
    @tobiasj8019 Před 14 dny

    If you wait to long with a rebase you get (maybe) a lot of conflicts too.
    I use a git rebase --onto the most time. Do you want to explain it or i could :-)
    btw. your teaching is awesome!

  • @Zeutomehr
    @Zeutomehr Před 15 dny

    7:00 it probably opens your default editor
    you can configure that by setting VISUAL or EDITOR or by running update-alternatives or whatever your distro calls that program

  • @hollow_ego
    @hollow_ego Před 15 dny +2

    I'd like a video about merging strategies for bigger teams and scenarios where you might need work from a different feature branch

    • @philomatics
      @philomatics  Před 15 dny

      Thanks for the suggestion! Do you have a concrete scenario that you've run into in the past that was difficult to handle?

    • @hollow_ego
      @hollow_ego Před 15 dny

      @@philomatics Yes, indeed several different. For a long time I was working with only one colleague on a project where we either only had one branch and rebased when getting the changes from remote or we worked independently on two branches. That worked absolutely fine.
      On the following project I worked with about 4 other frontend developers, where we worked pair wise on feature branches. For remote changes we rebased and the same for changes from main. So our feature branches would always be based on the latest changes from remote. We used force push with lease to update the remote feature branches, which of course required some communication. We had a lot of merge conflicts to resolve, which partially was due to project wide changes that affected our feature as well.
      In the current project we used one feature branch per "user story" that describes a part of a feature. We are 4 frontend developers once again, but in addition the backend developers are working in the same repository too. Usually one FE and one BE developer is working on one branch. However some features branches partially depend on the work from the other ones. So for example if we are developing feature A, then we have 3 branches: feature featA, featB and featC. To work on featB, you need at least some changes from featA and to work on featC you need the setup from featB.
      At the moment we handle this with rebasing, like so:
      - Branch featA is created
      - featA is implemented to a certain degree
      - Branch featB is created based on featA
      - Changes from featA are integrated into featB via rebase
      - featB is implemented to a certain degree
      - featC is created based on featB
      - Changes from featB are integrated into featC via rebase
      - featA is finished and gets merged into main
      - featB is rebased onto main
      - featC is rebased onto featB
      - featB is finished and gets merged into main
      - featC is rebased onto main
      - featC is finished and gets merged into main
      - Done
      So far this reduces the amount of merge conflicts we have. Though one complication is, that in the mean time there still can be other merges to main from bug fixes or other smaller improvements.
      Overall this works good, however we still have to force push with lease. Just yesterday, so right before your video, I was explaining what to look out for when rebasing and how the hashes change and that git wouldn't be able to tell that your local commits after the rebase are the same as the ones on remote. I asked them to always communicate a rebase beforehand, especially since those colleagues haven't worked with rebase before. My other colleague, who brought up this way of working, is more experienced and said he doesn't even have issues if he still has local commits. I assume this is still fine because we are still rebasing when fetching remote.
      Previously we worked in such a way that you would only start featB when featA was merged into main. But that slowed down development.

    • @hollow_ego
      @hollow_ego Před 15 dny

      @@philomatics Yes, indeed several different. For a long time I was working with only one colleague on a project where we either only had one branch and rebased when getting the changes from remote or we worked independently on two branches. That worked absolutely fine.
      On the following project I worked with about 4 other frontend developers, where we worked pair wise on feature branches. For remote changes we rebased and the same for changes from main. So our feature branches would always be based on the latest changes from remote. We used force push with lease to update the remote feature branches, which of course required some communication. We had a lot of merge conflicts to resolve, which partially was due to project wide changes that affected our feature as well.
      In the current project we used one feature branch per "user story" that describes a part of a feature. We are 4 frontend developers once again, but in addition the backend developers are working in the same repository too. Usually one FE and one BE developer is working on one branch. However some features branches partially depend on the work from the other ones. So for example if we are developing feature A, then we have 3 branches: feature featA, featB and featC. To work on featB, you need at least some changes from featA and to work on featC you need the setup from featB.
      At the moment we handle this with rebasing, like so:
      - Branch featA is created
      - featA is implemented to a certain degree
      - Branch featB is created based on featA
      - Changes from featA are integrated into featB via rebase
      - featB is implemented to a certain degree
      - featC is created based on featB
      - Changes from featB are integrated into featC via rebase
      - featA is finished and gets merged into main
      - featB is rebased onto main
      - featC is rebased onto featB
      - featB is finished and gets merged into main
      - featC is rebased onto main
      - featC is finished and gets merged into main
      - Done
      So far this reduces the amount of merge conflicts we have. Though one complication is, that in the mean time there still can be other merges to main from bug fixes or other smaller improvements.
      Overall this works good, however we still have to force push with lease. Just yesterday, so right before your video, I was explaining what to look out for when rebasing and how the hashes change and that git wouldn't be able to tell that your local commits after the rebase are the same as the ones on remote. I asked them to always communicate a rebase beforehand, especially since those colleagues haven't worked with rebase before. My other colleague, who brought up this way of working, is more experienced and said he doesn't even have issues if he still has local commits. I assume this is still fine because we are still rebasing when pulling remote.
      Previously we worked in such a way that you would only start featB when featA was merged into main. But that slowed down development.

    • @hollow_ego
      @hollow_ego Před 15 dny

      @@philomatics I wrote rather detailed reply, but my comment seems to go missing. I can still give you the whole description if you want, but for now the short story:
      In the current project we used one feature branch per "user story" that describes a part of a feature. We are 4 frontend developers once again, but in addition the backend developers are working in the same repository too. Usually one FE and one BE developer is working on one branch. However some features branches partially depend on the work from the other ones. So for example if we are developing feature A, then we have 3 branches: feature featA, featB and featC. To work on featB, you need at least some changes from featA and to work on featC you need the setup from featB. So far this reduces the amount of merge conflicts we have. Though one complication is, that in the mean time there still can be other merges to main from bug fixes or other smaller improvements.
      Overall this works good, however we still have to force push with lease.

    • @philomatics
      @philomatics  Před 9 dny +1

      @@hollow_ego Thank you very much for describing the situation! I'll see if I can work this into a future video. Feel free to email me if you have further questions (email in YT about page).

  • @jinx.love.you.
    @jinx.love.you. Před 7 dny

    It would be very interesting if you could make a video about the configuration and the integration between Git and the remote repos.
    There are some obscure things like "verified" commits and other things I never truly understood but I did it...

  • @infinite4evr
    @infinite4evr Před 11 dny

    Hi, great video, Me and my colleague were discussing on the rebase disadvantages and this video popped up, great explanation.
    Meanwhile, may i know what animation software or library you're using to creare your videos ?

    • @philomatics
      @philomatics  Před 11 dny +1

      Thanks for the nice comment! I'm using Motion Canvas :)

    • @infinite4evr
      @infinite4evr Před 11 dny

      @@philomatics thank you ! Btw only some videos and your subscription base much more explains that you're doing so good at explaining crisply.
      Power and success to you 😊

  • @drakezen
    @drakezen Před 13 dny

    I love Vim....and I also love your channel. Great work. For other topics, do you want to get into other devops tools such as K8s, Nomad, Terraform, etc..?

    • @philomatics
      @philomatics  Před 12 dny

      Thank you!
      Also, thanks for the suggestions, will consider it!

  • @sahajmalla
    @sahajmalla Před 14 dny +1

    Instead of going through commits one by one at a time for conflicts, it would be easier if we squash the commit into 1 commit and then try the rebase. This way you will only have to deal with 1 conflict.

    • @philomatics
      @philomatics  Před 14 dny

      That's a good suggestion! Didn't want to do squashing as well in this video as I thought it would be a bit overwhelming. But definitely a good option.

    • @sahajmalla
      @sahajmalla Před 14 dny

      @philomatics no problem. I'm just sharing the users to know that this is also an option instead of being overwhelmed by lots of commit's conflicts

    • @philomatics
      @philomatics  Před 13 dny

      It was a really good point, I wish I would've included that in the video. Maybe in a follow up :)

  • @sineshkumarr
    @sineshkumarr Před 13 dny

    Tutorial on Rebase + Squash

  • @krissh_the_dev
    @krissh_the_dev Před 15 dny

    I want the video on interactive rebase 🖐

  • @bboydarknesz
    @bboydarknesz Před 11 dny

    So, it means that git merge is better than git rebase?
    Since I can push my changes whenever I want without afraid of conflict like git rebase,
    and have to resolved it one by one.
    Since I usually changes between branch while developing but have to create another branch from main for fixing.

    • @philomatics
      @philomatics  Před 10 dny

      I wouldn't say one is better than the other. It depends on the situation and the workflow in your team. Also the number of merge conflicts you get doesn't change much either way.

  • @SimoneCattaneodango
    @SimoneCattaneodango Před 4 dny

    As a junior i have a question...
    If I plan to work on an important feature while other colleagues carry on other features should I simply avoid rebase?
    Or is keeping the branch local not so bad?

    • @philomatics
      @philomatics  Před 3 dny +1

      In my opinion, it's fine to keep branches local and rebase as much as you like before you push.

    • @SimoneCattaneodango
      @SimoneCattaneodango Před dnem

      @@philomatics got it, thank you so much 😀

  • @OpenDeepLearning
    @OpenDeepLearning Před 15 dny

    8:20 - I do want to see a full video on this. This was my scenario today: I created like 12 commits today. In the 3rd commit I forgot to add into the commit a line from package.json. I rebased using interactive mode, edited that commit, staged the changes and then git commit --amend. It said there are no changes or something. If I wrote git rebase --continue I was getting an error that I have conflicts and need to resolve them. I had zero conflicts.
    Fast forwards, did this multiple times and advanced a bit and somehow at the end another file (it was un Changes state) was committed idk how. Eventually I gave up, I have created a separate branch, cherry picked and edited the commits and that was all...
    git rebase is hard. Need your help.

    • @philomatics
      @philomatics  Před 15 dny

      Hmmm kinda hard to diagnose remotely but it sounds like your general approach was correct. You'd basically set the 3rd commit to edit when starting the interactive rebase, make your edits, and when finished run git rebase --continue (no need to amend but I think it also shouldn't hurt). Then when running into conflicts, the process is the same as in this video.
      I'd have to see precise error messages to give more help probably. You can email me (CZcams About page) if you want :)

  • @mivalentine2794
    @mivalentine2794 Před 16 dny

    Iam convinced that it probaly took weeks to beat Rebasius, Lord of branches.

  • @andregoncalves-sm5ii
    @andregoncalves-sm5ii Před 14 dny

    What is your opinion on doing git rebase onto another branch?

    • @philomatics
      @philomatics  Před 14 dny +2

      Sorry, not sure I understood the question. Do you mean rebasing onto another branch than main? Nothing wrong with that if the situation calls for it. The main thing you gotta watch out for is if the branch/commits you're rebasing have already been pushed.

    • @andregoncalves-sm5ii
      @andregoncalves-sm5ii Před 12 dny

      @@philomatics thx

  • @tanujkanti1088
    @tanujkanti1088 Před 2 dny

    Is there any way to avoid this repetition of rebasing after --continue or --skip if i have resolved my code in the first time. Because every time after --continue command i have new conflicts to resolve? Please answer!

    • @philomatics
      @philomatics  Před 2 dny

      Depending on your situation, it can help if you squash first before doing the rebase. Check out my video on interactive rebasing to see how to do that.

    • @philomatics
      @philomatics  Před 2 dny

      git interactive rebase - Undo, Edit & Squash git commits with a single command
      czcams.com/video/42392W7SgnE/video.html

    • @tanujkanti1088
      @tanujkanti1088 Před dnem

      Thanks I'll try that

  • @josetovarrodriguez3525
    @josetovarrodriguez3525 Před 15 dny +1

    Hey dude i always have problem with git rebase command, it ever rebase in main/master branch and nt in feature branch

    • @philomatics
      @philomatics  Před 12 dny

      Hey, what exact command(s) are you using? What's your branching structure (what's the output of git branch -a)?

    • @josetovarrodriguez3525
      @josetovarrodriguez3525 Před 7 dny

      @@philomatics
      1. It is a complex structure righ now 😅
      2. git rebase master (from feature branch)

  • @edgararrizon5736
    @edgararrizon5736 Před 14 dny

    godlike content, and at low subs. thats ripe

    • @philomatics
      @philomatics  Před 14 dny

      Thank you! Channel is still pretty new :) Please share with colleagues, every little bit helps :)

    • @edgararrizon5736
      @edgararrizon5736 Před 13 dny

      @@philomatics nah man, this knowledge is just for me. jk
      what other sorts of videos do you have planned?

    • @philomatics
      @philomatics  Před 13 dny

      I got more stuff on git in the works - any specific requests about other topics? :)

  • @r-i-ch
    @r-i-ch Před 15 dny +1

    Squash! Squash!

    • @philomatics
      @philomatics  Před 12 dny

      Do you mean "you should squash", or does that mean you'd like a video on squashing? :)

  • @FarukLuki111
    @FarukLuki111 Před 11 dny

    So if I already pushed my branch to „origin“ I should not use rebase? That makes rebase useless (for me)

    • @philomatics
      @philomatics  Před 11 dny

      You _can_ also rebase a branch that you pushed, but you gotta be sure that nobody else has pulled it or pushed to it. So if you're working on your own feature branch where that's the case, you're still safe.

  • @user-yk7rc6fq2k
    @user-yk7rc6fq2k Před 16 dny

    Just a reminder: there are no links to videos in the description.

    • @philomatics
      @philomatics  Před 16 dny

      Hey, thank you so much for letting me know! I completely forgot about that. Thanks!

    • @user-yk7rc6fq2k
      @user-yk7rc6fq2k Před 15 dny

      @@philomatics NP. Keep making videos like this.

  • @severgun
    @severgun Před 14 dny

    In previous video you say "use pull rebase". Now you say it is not a good idea to rebase if pushed. Can I have more comments on this?

    • @philomatics
      @philomatics  Před 14 dny

      Sure! So in the previous video, the commits that were rejected by the remote, the new ones on your computer, were not yet pushed. Since they are rejected when you try to push, the server doesn't have them yet - thus it's totally safe to rebase them with git pull --rebase. Let me know if anything is unclear :-)

  • @someonesalt5084
    @someonesalt5084 Před 11 dny

    When are you actually working on a branch that isn’t pushed?

    • @philomatics
      @philomatics  Před 11 dny

      You _can_ also rebase a branch that you pushed, but you gotta be sure that nobody else has pulled it or pushed to it. So if you're working on your own feature branch where that's the case, you're still safe.

    • @someonesalt5084
      @someonesalt5084 Před 11 dny

      @@philomatics I guess it feels pretty useless as most projects are collaborative

    • @philomatics
      @philomatics  Před 11 dny

      @@someonesalt5084 Well, it really depends on your branching workflow. If you commonly work on the same branch as a team member, this video might help you more: czcams.com/video/xN1-2p06Urc/video.html

  • @waynelau3256
    @waynelau3256 Před 10 dny +2

    When in doubt, force

  • @AkashSingh-hs5sg
    @AkashSingh-hs5sg Před 15 dny +1

    Squash

    • @philomatics
      @philomatics  Před 12 dny

      Do you mean "you should squash", or does that mean you'd like a video on squashing? :)

    • @AkashSingh-hs5sg
      @AkashSingh-hs5sg Před 12 dny

      ​@@philomaticsvideo on squash

  • @renzrowendeleon993
    @renzrowendeleon993 Před 13 dny

    I still dont understand

    • @philomatics
      @philomatics  Před 12 dny

      Hey, any specific questions or parts that were confusing? Let me know how I can explain better :)

  • @DerSolinski
    @DerSolinski Před 15 dny

    Guys, guys... GUYS!!!
    LISTEN FOR ONCE!
    I know you like the pretty rainbow...
    but you're doing it WRONG!

  • @j.r.r.tolkien8724
    @j.r.r.tolkien8724 Před 15 dny +1

    I don't think there's much benefit of using a versioning system if you're just gonna discard the history like that. There should a different tool for you guys.

    • @squishy-tomato
      @squishy-tomato Před 15 dny

      wdym discard the history? Squash discards the history, rebasing forces a linear history

    • @jp93k
      @jp93k Před 13 dny +2

      Yeah but the history on main matters not the history on your random branch whilst it is still a work in progress

    • @dvdrtrgn
      @dvdrtrgn Před 9 dny

      Git is the system for tracking **and** managing history. Sometimes I wanna get rid of a bunch of junk from history. I love git and I squash and re-base all the time.

  • @abdullahX001
    @abdullahX001 Před 11 dny

    $5000 for the workshop? Welp

    • @philomatics
      @philomatics  Před 11 dny

      The workshops are more for established companies that prefer personal interaction and support :) Stay tuned for more free content here and on my site!