Resolve Git Cherry Pick Merge Conflicts

  Рет қаралды 32,782

The Modern Coder

The Modern Coder

Күн бұрын

Learning any Git technique can be this easy: learngit.io/
-----
🎥 GIT CHERRY PICK VIDEO: • Git Cherry Pick Tutorial
⌨️ WRITTEN ARTICLE: www.themoderncoder.com/fix-gi...
DESCRIPTION
In this video I will show you how to fix the two most common git merge conflicts that could come up during this workflow. Resolving git cherry pick conflicts applies the changes introduced by the selected commit(s) onto the current branch. If changes introduced by the picked commit conflict with changes on the current branch, you will see a git merge conflict.
CHAPTERS
0:00 Intro to Git merge conflicts
0:30 Demonstration of a merge conflict
1:54 Fixing the merge conflict
4:34 Merge conflict with local changes
MY TECH
www.themoderncoder.com/wfh-ny...
MUSIC CREDITS
uppbeat.io/t/danijel-zambo/st...
License code: LQUKNJGUWBL7FJLX
#git #linux #programming #github #learngit #coding #codingtips

Пікірлер: 54
@josuerbague6851
@josuerbague6851 9 ай бұрын
These videos are a treasure and should be protected for future generations.
@iatheman
@iatheman 4 ай бұрын
You're on the way to the top with this style of explanation. Well done and thanks for making these.
@GergalovSergey
@GergalovSergey Жыл бұрын
Thank you! Very clear and easy-to-use explanation!
@AnantaAkash.Podder
@AnantaAkash.Podder 6 ай бұрын
Your Videos are just the BEST Explanation about Git... with the Animation... it helps a lot
@vincenguyendev
@vincenguyendev Жыл бұрын
looking forward to git-stash :)
@themoderncoder
@themoderncoder Жыл бұрын
Here you go - just posted today: kzbin.info/www/bejne/eISvq3RupKiHbck
@jordigonzalez6672
@jordigonzalez6672 Жыл бұрын
Great Graphical demonstration. Thanks!
@lucienchu9649
@lucienchu9649 2 ай бұрын
Well and clear explanation, thanks.
@user-ln6yi9qu9v
@user-ln6yi9qu9v Жыл бұрын
Great Explanation!!! All things are easy to understand because of Graphical demonstration.
@themoderncoder
@themoderncoder Жыл бұрын
Glad it was helpful!
@niksingh710
@niksingh710 2 ай бұрын
was searching for cherry pick and mate just gonna say you explained it in the most simplest and understandable way. those animation with actual commit Strings was so much helpful while seeing the commands get executed. Loved your content!!
@themoderncoder
@themoderncoder 2 ай бұрын
Heck yeah, glad it helped
@matk2283
@matk2283 2 ай бұрын
Brilliant !!. simplicity combine with your animation and your delivery = treasure of a story teller about git. anyone wants to learn git, better sit down/listen to this gentleman and soak it up. my friend, you are one in a million for sharing your knowhow and for that I am so Thankful !!.
@yuriytopin8040
@yuriytopin8040 2 ай бұрын
Very clear explanation. Thank you, it was very helpful.
@themoderncoder
@themoderncoder Жыл бұрын
Git cherry pick tutorial: kzbin.info/www/bejne/n2eYaHWdlK10jas. I also have more Git videos! kzbin.info/aero/PLfU9XN7w4tFwKwh_xPSQ_X1-hROQEpHnM Lastly, a written reference of what was explained in this video is available at: www.themoderncoder.com/git/
@FullMetalAlgorithmist
@FullMetalAlgorithmist 3 ай бұрын
Yo man, these are some seriously good underrated vids!❤
@themoderncoder
@themoderncoder 3 ай бұрын
Appreciate it. If you ever come across someone who could benefit from a video of mine, please share it!
@arcanelore168
@arcanelore168 3 ай бұрын
I love your content!
@themoderncoder
@themoderncoder 3 ай бұрын
Thank you!
@chino.lluvia2868
@chino.lluvia2868 10 ай бұрын
Thank you so much. The best git videos I've ever seen.
@themoderncoder
@themoderncoder 10 ай бұрын
Appreciate that compliment, wow!
@user-gy9is8ut5m
@user-gy9is8ut5m Жыл бұрын
Good job bro!
@sanjaykrishnan8379
@sanjaykrishnan8379 3 ай бұрын
Thank you so much, Great Explation.
@user-vr1od8gk5d
@user-vr1od8gk5d 2 ай бұрын
damn those animations really making it easier to understand gj
@gc368
@gc368 Жыл бұрын
Explained in a very comprehensive way, well done, thanks. Do you mind sharing which tools and technics you used for recording this material? Would be interesting to see it as a separate video.
@themoderncoder
@themoderncoder Жыл бұрын
Thanks for the comment, glad these are helping you. I plan to release a comprehensive series of Git videos in the coming months, and after that will do a video on how I made these.
@overrevvv
@overrevvv 8 ай бұрын
Thank you so much for these fantastic videos.
@themoderncoder
@themoderncoder 8 ай бұрын
Thanks for watching them :)
@MdShamimRahman
@MdShamimRahman 5 ай бұрын
This is good stuff.
@veronikas.1347
@veronikas.1347 11 ай бұрын
thanks, it worked for me
@isaacambi1914
@isaacambi1914 Жыл бұрын
You are the best
@the_univi_kid
@the_univi_kid 9 ай бұрын
Impressive. Subscribed.
@themoderncoder
@themoderncoder 9 ай бұрын
I saw you commented on both my cherry pick videos! Thanks for taking the time to say that - I really appreciate the support
@poojaguru2516
@poojaguru2516 Жыл бұрын
saved my life
@tambuidev
@tambuidev 4 ай бұрын
First of all, great video! Extremely helpful and I learned a lot. Secondly, I would argue that starting at 4:35, if you are encountering this problem, then you have a personal problem managing your own work. Try not to get into a situation where you yourself have manually edited the same file differently in two branches. Just my opinion 🤷
@themoderncoder
@themoderncoder 4 ай бұрын
Yeah that’s fair, the example is a little contrived. It’s funny you point this out because I put off doing the screen recording for that part because I was struggling to think of a realistic, yet somewhat straightforward situation that would cause a merge conflict. But those two qualities don’t really go together when you’re talking about merge conflicts
@kobi219040
@kobi219040 5 ай бұрын
wow man!
@zigzagging256
@zigzagging256 10 ай бұрын
Really informative video! But I have 1 question left: at 1:22 what would the "--skip" command do?
@themoderncoder
@themoderncoder 10 ай бұрын
If you’re cherry picking multiple commits, -skip will tell Git to skip the current commit in the sequence and move onto the next one
@zigzagging256
@zigzagging256 10 ай бұрын
@@themoderncoder so will it work as the abort-option for this particular commit or just postpone the conflict to the end of the sequence?
@themoderncoder
@themoderncoder 10 ай бұрын
@@zigzagging256 yes exactly. It essentially works as an abort but only for that specific commit in the sequence.
@zigzagging256
@zigzagging256 10 ай бұрын
@@themoderncoder understood. Thank you very much!
@sidneyjacques1887
@sidneyjacques1887 11 ай бұрын
Trying to get better with reading conflict diffs... when you did the manual resolution you excluded the instagram_username, how did you know to omit i? Does it matter which branch is newest?
@themoderncoder
@themoderncoder 10 ай бұрын
In this case, all I was thinking about was manually editing that block to be whatever I wanted it to look like after the merge. It shouldn't matter which is newer because you're moving commits between branches. Since the branches are tracking two different "flows" of work, the timing of when those commits made it into the Git tree isn't relevant to what the merge should look like. If you're on a team, you'd need to collaborate with the author of the code block in question and work it out.
@tambuidev
@tambuidev 4 ай бұрын
I honestly think this was a miss on his part (especially by the fact that it was never explained in the video starting at 2:57). The nav branch included the instagram_username line but the main did not. When fixing the merge conflict, he should have known to keep that line in the final product because the nav branch developer added it.
@themoderncoder
@themoderncoder 4 ай бұрын
I’d probably agree that keeping lines that were newly added (like instagram_username) won’t generally be a problem, but it’s not failsafe in all situations. The safer advice would be to confer with both branch authors, or make a case-by-case judgement call if you’re the subject matter expert. So I still stand behind the advice from earlier in the thread, but now that I’m talking through all this, I agree it was a miss not to include this nuance in the video. I should probably make a dedicated video on merge conflict resolution strategy.
@Braven36
@Braven36 Ай бұрын
What happen when nav is merged into main after a cherry pick. Will the old hashes for cherry pick commits be merged still?
@themoderncoder
@themoderncoder Ай бұрын
If nav is merged using a "git merge" both commits remain (the original and the cherry-picked commit). If nav is rebased onto main, then the cherry-picked commit WON'T be replayed onto main and Git will output something like this: "warning: skipped previously applied commit"
@Braven36
@Braven36 Ай бұрын
@@themoderncoder Thanks
@l3ertuz362
@l3ertuz362 3 ай бұрын
@2:11 you rolled back but did not issue the cherry-pick command
@themoderncoder
@themoderncoder 3 ай бұрын
Sorry about that confusion. I wanted to demonstrate what aborting the cherry pick would look like. Just imagine at 2:11 I never issued the abort in the first place.
@aspineux
@aspineux 8 ай бұрын
Specifying the hash d81b1f0 in the commit subject is irrelevant because this commit could never reach the remote repository. If you do a git rebase of your nav branch or never push your nav branch!
@themoderncoder
@themoderncoder 7 ай бұрын
You’re saying the cherry picked commit on main could never reach the remote repository? I guess what I was trying to demonstrate was that the nav branch was already in the remote repository because another collaborator authored it.
Git Stash Tutorial
6:59
The Modern Coder
Рет қаралды 19 М.
Git MERGE vs REBASE: The Definitive Guide
9:39
The Modern Coder
Рет қаралды 60 М.
КАК СПРЯТАТЬ КОНФЕТЫ
00:59
123 GO! Shorts Russian
Рет қаралды 3 МЛН
Would you like a delicious big mooncake? #shorts#Mooncake #China #Chinesefood
00:30
когда достали одноклассники!
00:49
БРУНО
Рет қаралды 3,5 МЛН
Do you have a friend like this? 🤣#shorts
00:12
dednahype
Рет қаралды 48 МЛН
The easiest way to chat with Knowledge Graph using LLMs (python tutorial)
18:35
5 (questionably useful) Git tips
8:11
The Modern Coder
Рет қаралды 1,4 М.
Search Git Branches and Commits Using fzf
6:07
Andrew Courter
Рет қаралды 3,6 М.
Git PULL vs FETCH
7:13
The Modern Coder
Рет қаралды 3 М.
Resolve Git Stash Merge Conflicts
6:17
The Modern Coder
Рет қаралды 10 М.
Unlock Git collaboration with CLONE, PUSH & FETCH
9:09
The Modern Coder
Рет қаралды 2,9 М.
How Git Works: Explained in 4 Minutes
4:18
ByteByteGo
Рет қаралды 126 М.
КАК СПРЯТАТЬ КОНФЕТЫ
00:59
123 GO! Shorts Russian
Рет қаралды 3 МЛН