To clarify a common misconception: A "tree" in the context of Git does not refer to a commit history (because that is not in fact a tree in the mathematical sense due to merges, actually it's a DAG) but it refers to a snapshot of the repo, i.e. the content of a commit and therefore a filesystem tree. That might be important to know so not to get confused when reading the Git docs and learning about the Git working tree.
@user-oj9iz4vb4q16 сағат бұрын
It's simple, never fucking rebase. The very concept of rebasing is fundamentally flawed and only used by damaged OCD people.
@mxsniper22323 сағат бұрын
شكرا جزيلا .. thanks' a lot man
@DavidPashleyКүн бұрын
I think you may have an incorrect mental model of vim. The escape is not part of the quit command. The default mode in vim is the command mode. i puts you into insert mode and escape leaves insert mode and returns you to command mode. Colon moves you to another mode: ex mode where you can type ex commands. The ex command you're using in this situation is wq. If you're using escape before quitting even when in command mode, then it suggests you're not thinking of insert mode as something you dip in and out of before returning to the steady state of command mode and possibly missing out on the incredible power of command mode.
@themoderncoder21 сағат бұрын
Your comment is a nice, succinct explanation of what I glossed over in the video. It seemed more approachable to gloss over vim modes to make sure folks could save & close a file without knowing which mode they were in. I'll admit my vim knowledge beyond simple commands is limited, I remember first starting out watching senior devs fly through code in vim, and being very jealous. Hopefully one of these days I'll find the time to up my skills!
@DavidPashley21 сағат бұрын
@@themoderncoder Yep, vim is complicated, mostly because it's very different from almost any other editor that just lets you type and go. It's not helped that it's built on top of a very limited editor designed for teletypes (ed and then ex) When I was starting out, I had the same misunderstanding of vi, but someone much smarter than me gently corrected me and I became much more fluent.
@UTube2K6Күн бұрын
9:15
@coreC..Күн бұрын
This is a clear explanation. Very good.
@sarvanisah27462 күн бұрын
if we are using vi config.yml for vim ide , what command we will use for vs code ide?
@themoderncoderКүн бұрын
If you use VS Code you can either open config.yml manually via the file explorer or (if you've configured VS Code to be able to launch from the command line code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line) you could type "code config.yml"
@rezakaaccount2 күн бұрын
Production quality is remarkable.
@mehdizahedi28102 күн бұрын
Fantastic explanation, resolved all my confusion about merging. Thanks
@kaibe52412 күн бұрын
This isn't even close to being definitive... It skips over so many features that git provides for managing conflicts.
@CristianHeredia02 күн бұрын
Great content! What are you using to make slides?
@themoderncoder2 күн бұрын
I use Apple Motion to create the animations. Then stitch all the animations together with Final Cut. It’s a bit of a manual process unfortunately - these videos take me a very very long time to make lol
@davidpaez_co2 күн бұрын
This is honestly the best git course in all KZfaq. Thank you so much!
@himanshutripathi57353 күн бұрын
So we merge after rebase? just rebase and push is bad practise? Please clarify. Thanks!
@themoderncoder3 күн бұрын
Generally yes. This video should clear your question up kzfaq.info/get/bejne/sLWeqsqpzqmUf3U.htmlsi=jsqtiCaVkMr2WBLr
@azolee3 күн бұрын
in my almost 15 year of using Git, this is by far the best video on how to use merge and rebase. thank you!
@themoderncoder3 күн бұрын
Really appreciate you saying that. It means a lot coming from someone like you with so much experience. If you have a chance to share this video with someone who might benefit, please do. Cheers!
@azolee3 күн бұрын
@@themoderncoder already did it :)
@edgarlip24 күн бұрын
very cool , thank you !!!
@davidgood8404 күн бұрын
As a single dev , I only ever use rebase amd NEVER merge just to keep the history strictly linear , however this is a luxury that larger teams might not have . The tip about only using rebase for your own local work is 100% the right way to use it , imo .
@daymenpasick78255 күн бұрын
My guy at the very beginning when you described git pull as being a combination of fetch and merge...it already instantly clicked for me xD thank you!
@EzMC25 күн бұрын
Nicely done, thanks my dude.
@yssplays26206 күн бұрын
new subscriber. best explain very very very nice
@themoderncoder6 күн бұрын
Thank you so much 🙂
@SalvadorAguilar9 күн бұрын
Thank you a lot for this brother!
@themoderncoder9 күн бұрын
For sure, glad it was helpful. If you know anyone else who would benefit, please share a link!
@tarsala199511 күн бұрын
I always squash and never allow teammates to work on my branch. This way you maintain main branch clean with only feature commits and avoid conflicts with teammate locally. The only use case I had was when I was introducing a big feature >100 files and split my PR into 6, then I was rebasing branches in order of building block of the feature, where last branch was rebased into main feature branch after reviews of my peers.
@themoderncoder11 күн бұрын
This a good anecdote for folks - in the real world sharing branches is not very common and workflows like you describe are more the norm.
@jojje3000-112 күн бұрын
Git mergetool is also useful
@ekchills694812 күн бұрын
Best explanation
@fouadchahd296912 күн бұрын
Please can u provide commads also
@themoderncoder11 күн бұрын
This is the video you’re looking for: Git MERGE vs REBASE: The Definitive Guide kzfaq.info/get/bejne/sLWeqsqpzqmUf3U.html
@RakeshKumar-tu6bi13 күн бұрын
perfect
@porchmail15 күн бұрын
Truly appreciate! This is one of the best IT tutorial videos that I’ve ever seen!
@subramanyakrishnamurthy835215 күн бұрын
"No nonsense, just get to the point" videos. Very easy to follow and much appreciated!!
@chrism901715 күн бұрын
1:00-1:05 "... my local main branch hasn't changed". Light bulb on.
@nipping121216 күн бұрын
Great video :)
@EricMuranoAU16 күн бұрын
If you push your feature branch to remote, but no one touches your branch, is rebase still safe?
@themoderncoder16 күн бұрын
Yeah, rebase should be pretty safe in that scenario.
@shoooozzzz16 күн бұрын
thank you for a true lightbulb moment! It just makes sense now
@shoooozzzz16 күн бұрын
You are the git goat with your visualizations.
@CentreMetre16 күн бұрын
I first seen your merge vs rebase a couple days ago and it really helped explain. KZfaq seemed to agree and recommended me this straight after uploading (im not subscribed), and again really helpful video. Gonna have to check out more!
@themoderncoder16 күн бұрын
Good to hear. These videos end up taking way longer than I think to film and animate, so it really makes me feel like it’s worth it when I get comments like yours.
@shoooozzzz16 күн бұрын
@@themoderncoder the time spent is worth it. You are creating a better world for software devs
@hrahman312316 күн бұрын
You always have great videos. Keep it up!
@devcallum16 күн бұрын
Not first but second
@themoderncoder16 күн бұрын
Let’s go! I never get “first” or “second” comments on my vids!!
@linbynd16 күн бұрын
perfect !!!
@user-lk1md5mn1i18 күн бұрын
not useful
@alenscaria151620 күн бұрын
Syncing repos was a nightmare for me. Not anymore! Thanks A lot!!!
@user-eq4zl8mq7k20 күн бұрын
thank you so much. this has been the clearest explanation I`ve encountered. I have a test soon about this topic, and also need it currently for another school project :)) but solving the conflict on the terminal always seemed so intimidating
@siddharthnayak444821 күн бұрын
I had faced an issue while uptaking merge branch additional commits into feature branch using git merge in gitlab UI where merge conflict was arising. When I resolved then conflict on gitlab UI itself and merge request was granted, both the main and feature branches got merged into each other and main branch had the commits of feature branch😠. Any reason for this weird behaviour?
@Brxndz_21 күн бұрын
This was awesome! Online can make rebase look so terrifying
@AkimboFennec22 күн бұрын
I read the official pro git textbook, but did not understand what i should have done with the conflict. Then i searched for git merge conflict and found your KZfaq channel. Thank you for this video. The only recommendation is to speak a little bit slower, to give us time to digest the information. Other than that I really loved the combination of an animated graph, which underpins the theory, and a practical conflict resolution using a manual process, or VScode. Again thank you. By the way i will checkout the website and purchase the git course.
@themoderncoder21 күн бұрын
Appreciate that! Definitely check out the course. Pacing is not the only reason, but I feel more comfortable taking my time and going really deep in the LearnGit.io lessons. YT seems to favor those shorter, punchier style videos (and I agree) they’re not always the right fit, especially for the more complicated Git concepts.
@mariocalderon214823 күн бұрын
Thank you, amazing! I was always "afraid" of using cherry picking, but with this excellent explanation I will use it often.
@Confusedcapybara877223 күн бұрын
Great video. Would love to see how this plays with pull requests
@themoderncoder23 күн бұрын
True. My next few videos will be on Git collaboration and I think PRs could fit nicely into that series
@kirank336823 күн бұрын
This is insane ❤
@joaomendoncayt25 күн бұрын
Amazing video.. Was struggling a bit with conflicts and the log and decided to dedicate an hour for a couple videos to once and for all kill all the missing pieces in my mental model even though I use git for years... One thing that wasn't 100% clear is at the end of the video the "recommended workflow" tells you to rebase your branch and then merge it when ready, but that doesn't apply if the branch is on remote and has more people working on it correct? That would mean that remote branches should never get the latest changes from their parent branch unless absolutely necessary, and in that case you'd need to merge from the parent branch.
@themoderncoder23 күн бұрын
Right, that would necessarily apply if multiple people are working on the same remote branch. Like you said though, in those cases you can merge main INTO the remote branch - you’ll just end up with a merge commit which isn’t too bad.
@mariocalderon214826 күн бұрын
Thanks a lot! At last after several years using Git, I (think) I finally grasped it.
@celikvolkan26 күн бұрын
Best explanation I have ever seen on KZfaq about merge vs rebase. Thank you for sharing.😺
@budivoogt49126 күн бұрын
Great video, thanks for the effort.
@abcdabcd860527 күн бұрын
Amazing explanation. Those animations made it very easy to understand.