Git rebase: how to resolve conflicts

  Рет қаралды 39,041

Team Programmer

Team Programmer

Күн бұрын

Conflicts resolution process during git rebase is somewhat confusing to a lot of developers I've worked with. In this video I try to explain it as simply as possible and then show the simple way to do it.
Buy me a coffee: www.buymeacoffee.com/teamprog...
Contents:
0:00 Short sketch - thank you Bryan and Danny!
0:26 Git rebase recap, short explanation
1:36 Demo of git rebase with conflicts
Next up: squashing commits with git rebase.
Follow me online:
LinkedIn: / alex-kovshovik
Twitter: / ashovik
Personal KZfaq: / @alexkovshovik
Instagram: / alex.kovshovik
Facebook: / ashovik
Mastodon: mastodon.social/@alex_kovshovik

Пікірлер: 65
@jasonfreeman8022
@jasonfreeman8022 Ай бұрын
I watched this video after having some difficulty with a git rebase and the video photo perfectly captured my feelings after working with the rebase.
@TokyoXtreme
@TokyoXtreme 2 жыл бұрын
A channel with this level of production value has only 38 subscribers!? This video has the best explanation I’ve seen so far of rebase conflict resolution. Make me #39.
@ShadyRonin
@ShadyRonin Жыл бұрын
Thank you for this video! It's helpful to just see you go through the steps and pause to explain what we're looking at frequently, and why we're seeing the step we're at. This is a great approach and makes it much easier to learn than reading documentation in some cases.
@alefrwx
@alefrwx 2 жыл бұрын
Nice! Your explanations are very didatical! Thank you! I'm curious about the next video.
@AC-ez9ky
@AC-ez9ky 2 жыл бұрын
Nice, great explanation. And I liked that "I always pull before push to avoid conflicts", had a nice laugh
@dxphilo
@dxphilo 2 жыл бұрын
Looool. Everytime I have some conflicts to resolve I come for this video. Thanks a bunch.
@mohammadsalman3257
@mohammadsalman3257 2 жыл бұрын
probably only video that exactly addresses my problem. thank you.
@AltruisticHedonism
@AltruisticHedonism 2 жыл бұрын
It's criminal more people haven't seen this, especially the cut-away head smash. Hope you continue with more vids some day!
@teamprogrammer9650
@teamprogrammer9650 2 жыл бұрын
Thank you so much! I'd like to do more with my team :) We're just a bit busy this Q4 at work :)
@imuentinyannosarumen9789
@imuentinyannosarumen9789 Жыл бұрын
This is an excellent explanation. I had this issue at work some days ago and had to go through the painful road of figuring an alternative way to do it because I could not understand the videos I came across. But watching your video now, I see what I should have done clearly and clearly sees how it would have solved the conflicts I had.
@AlexKovshovik
@AlexKovshovik Жыл бұрын
Thank you so much for your comment! It means a lot to me!
@dariatss
@dariatss Жыл бұрын
The sketch really cracked me up. More, please!
@teamprogrammer9650
@teamprogrammer9650 Жыл бұрын
Hi @Daria, let's face it - I only do the programmer videos so I could include silly sketches with them :) Working on another one as we speak!
@muhammadkashif-td7xn
@muhammadkashif-td7xn Жыл бұрын
Very well explained!
@rahulumap2969
@rahulumap2969 8 ай бұрын
Thank you for this video!
@larryoke3434
@larryoke3434 Жыл бұрын
I've been banging my head asking why do I keep getting the multiple conflicts during git rebase, I've looked everywhere, thinking I'm not doing it right. Now I know why, I should have done a squash first. Many thanks for that very last minute explanation, not even part if the video topic. It is why I came here. Many thanks
@teamprogrammer9650
@teamprogrammer9650 Жыл бұрын
Thank you @Larry\sOke! This means a lot to me. I didn't visit this channel in a while, been busy with my 4th child, and seeing comments like this motivates me to do more explainer type videos!
@stiantsse7382
@stiantsse7382 2 ай бұрын
I have been having this issue for years, so nice to finally figure it out
@jvanelteren
@jvanelteren 3 жыл бұрын
Great video, keep it up. This is really helpful to better understand git. It would also be nice to have something about branch strategy (trunk based vs gitflow or something). Or when to use a dev branch with separate feature branches. Or when to merge dev into master for a release
@teamprogrammer9650
@teamprogrammer9650 3 жыл бұрын
Thank you so much for feedback! I'd like to finish up rebase with the squashing and editing the commits, then I'll definitely talk about branching strategy: multiple long-lived branches vs a feature branches, release channels, etc. Best, Alex.
@andressalazar9671
@andressalazar9671 2 жыл бұрын
Thanks, this video was really helpful
@b.c.w6735
@b.c.w6735 9 ай бұрын
Thank you, this helped me a lot.
@huayang2467
@huayang2467 9 ай бұрын
Thank you so much, sir! For explaining this topic of rebasing with merge conflicts so well. I have watch many other videos. This is the clearest. I just used it to rebase and solve conflicts by myself for the 1st time! I thought I could never learn to do this by myself. It feels good to not have to plead my male colleagues for help with this all the time.
@teamprogrammer9650
@teamprogrammer9650 9 ай бұрын
Thank you for saying this! It means a lot to me! I'm working on the Kubernetes one now :) Takes time to do it right
@h4m74ro
@h4m74ro Жыл бұрын
This is the best video!
@jeelim442
@jeelim442 4 ай бұрын
The best one ever!
@alejandroperezrivas2397
@alejandroperezrivas2397 2 жыл бұрын
thank you so much! finally i undestand this
@teamprogrammer9650
@teamprogrammer9650 2 жыл бұрын
Thanks for watching! :)
@aliabdollahian1465
@aliabdollahian1465 2 жыл бұрын
very helpful thank u :)
@tarankaranth8782
@tarankaranth8782 Жыл бұрын
great stuff ..thanks
@jsagar95
@jsagar95 11 ай бұрын
Thanks!
@thekillercrab
@thekillercrab 2 жыл бұрын
this was so useful! when is the interactive rebase vid coming?
@teamprogrammer9650
@teamprogrammer9650 2 жыл бұрын
Hi @thekillercrab, thank you for kind words. Sorry, I’ve been inactive lately. Going to double down on a few new vids shortly - to give back to community!
@meer-uq4ns
@meer-uq4ns 3 ай бұрын
I had a situation where I could not force push the changes after I fixed 5 commit conflicts which ended by one of the commit going missing as there was no difference. Maybe that's why force push didn't work. So I rebased pulled from my remote feature branch to my local branch and I had to fix things all over again and it was pretty different. After fixing conflicts now it has become crazy and full of other people's commits. I'm now thinking of creating a new branch from my current updated main branch then add my changes manually from my old feature branch since I don't want to deal with what's going on there it's messed up!
@youtubeoneverything4581
@youtubeoneverything4581 Жыл бұрын
Thanks
@saschametz9018
@saschametz9018 2 жыл бұрын
Always so scary when you don't know exactly what you're doing. Thank you for clearing that up for me in the future!
@SandraWantsCoke
@SandraWantsCoke 7 күн бұрын
U menya vse ravno stoit "first resolve merge conflicts", which I of course did, I am not a beginner. Did it serveral times without luck, still the same error. Never used rebase and had to
@thierrybeaulieu4403
@thierrybeaulieu4403 Жыл бұрын
I was drinking some water while listenning at the video. At 0:47, I spat all of the water at my monitor because I laugh so hard.
@teamprogrammer9650
@teamprogrammer9650 Жыл бұрын
So sorry (not) LOL :)
@gyros9162
@gyros9162 Жыл бұрын
Спасибо из Воронежа )
@teamprogrammer9650
@teamprogrammer9650 Жыл бұрын
Привет из Юты! О чем разговор, на здоровье ;)
@alperari9496
@alperari9496 20 күн бұрын
0:47 must have hurt
@bmfitzgerald3
@bmfitzgerald3 Жыл бұрын
Thanks for the excellent video. At 4:05, you say "I can resolve this conflict in here, but this would create a merge commit, and a better way to do it is use a git rebase." ... Would appreciate some clarification on exactly _why_ is it better to use git rebase here versus using the UI and creating a "merge commit." Also, at 4:20, you used git fetch. Would git pull have done the job here, or does it have to be fetch? Why? Thanks for any additional insight!
@eddiethehead7466
@eddiethehead7466 Жыл бұрын
git pull is basically execution of git fetch and git merge in succession. So in a situation where you want to update your local branch with all the latest changes from remote but don't want git to initiate auto-merging, git fetch is your way.
@bmfitzgerald3
@bmfitzgerald3 Жыл бұрын
@@eddiethehead7466 thanks Eddie!
@SirBenJamin_
@SirBenJamin_ Жыл бұрын
At 4:20, how come you didn't have to pull the remote changes? I thought fetch only downloaded them without applying them?
@AlexKovshovik
@AlexKovshovik Жыл бұрын
Good question: fetch doesn’t apply changes to your local copy of main branch, but it does apply them to the origin/main “ref”, which is kinda a local mirror of the remote main. So when I rebase on top of origin/main after fetch, I am rebasing on top of latest commit from the remote main. I hope this makes sense :)
@dc33333
@dc33333 11 ай бұрын
ribs hurt from laughing so hard
@etymology_
@etymology_ 2 жыл бұрын
Did team programmer become a HR associate or something? There is not a next video, maybe he fell in the lake in Salt Lake City? RIP team programmer
@teamprogrammer9650
@teamprogrammer9650 2 жыл бұрын
I'm so sorry! I had a new child born and things got out of whack. Planning to get back to it, with more jokes :)
@mbponche
@mbponche 11 ай бұрын
I did that but there is a loop
@dhananjaysarsonia29
@dhananjaysarsonia29 4 ай бұрын
Isn't force push a bad strategy?
@teamprogrammer9650
@teamprogrammer9650 3 ай бұрын
It depends: if no one else checked out your feature branch - force pushing is not bad at all, you’re just overriding the state of the remote branch with your local state
@dhananjaysarsonia29
@dhananjaysarsonia29 3 ай бұрын
@@teamprogrammer9650 got it, thanks.
@manabroy3036
@manabroy3036 2 жыл бұрын
Thanks a lost.
@teamprogrammer9650
@teamprogrammer9650 2 жыл бұрын
Yep, sorry, I'm lost for a while.... Planning to get back to it.
@machinima1402
@machinima1402 Ай бұрын
I feel like he is struggling to not blink horizontally
@teamprogrammer9650
@teamprogrammer9650 Ай бұрын
You got me :D
@konstantinrebrov675
@konstantinrebrov675 2 жыл бұрын
This is not very helpful because it is a contrived example. I know the basics of how to resolve a merge conflict. I want to see practical examples of resolving merge conflicts. If for example you rebase one branch on top of your other branch, and you have merge conflicts, with duplicated work, how to solve it?
@teamprogrammer9650
@teamprogrammer9650 2 жыл бұрын
The example is simplified indeed, but the concept in the same: if you have duplicated work in 2 branches and you're trying to rebase one on top of the other: you'll get the same "social markup" in your files with conflicts and you're still responsible for resolving them manually. Sometimes it is not obvious which code changes to keep, so typically both developers hop on a Zoom call and hash it out together. Thanks for the feedback! I might record a video of a "REAL" conflict resolution from my work - if I have a particularly tough one :)
Git rebase basics
15:01
Team Programmer
Рет қаралды 12 М.
Git rebase is not that scary
21:44
Hitesh Choudhary
Рет қаралды 17 М.
Super gymnastics 😍🫣
00:15
Lexa_Merin
Рет қаралды 108 МЛН
Haha😂 Power💪 #trending #funny #viral #shorts
00:18
Reaction Station TV
Рет қаралды 15 МЛН
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 170 #shorts
00:27
Resolve Git MERGE CONFLICTS: The Definitive Guide
8:02
The Modern Coder
Рет қаралды 30 М.
Git: how cleanup commit history using interactive rebase
15:28
Team Programmer
Рет қаралды 5 М.
How to resolve merge conflicts in Git
6:36
Ihatetomatoes
Рет қаралды 269 М.
Everything You'll Need to Know About Git with ThePrimeagen | Preview
14:43
13 Advanced (but useful) Git Techniques and Shortcuts
8:07
Fireship
Рет қаралды 893 М.
Git MERGE vs REBASE: The Definitive Guide
9:39
The Modern Coder
Рет қаралды 87 М.
So You Think You Know Git - FOSDEM 2024
47:00
GitButler
Рет қаралды 1 МЛН
Git MERGE vs REBASE
16:12
Academind
Рет қаралды 1 МЛН
How I Resolve Git Merge Conflicts with Rebasing (Abort!)
17:49
GIT: Merge or Rebase? What's the difference?
10:47
Front-end Science із Сергієм Пузанковим
Рет қаралды 132 М.
Lid hologram 3d
0:32
LEDG
Рет қаралды 10 МЛН
Собери ПК и Получи 10,000₽
1:00
build monsters
Рет қаралды 1,9 МЛН