Git's most perplexing paradigm
5:05
5 (questionably useful) Git tips
8:11
I’m making a big bet…
4:19
10 ай бұрын
My toughest project yet
3:47
Жыл бұрын
Delete Git Commits Tutorial
5:03
Жыл бұрын
Coding ability is overrated
4:24
Жыл бұрын
Git Stash Tutorial
6:59
Жыл бұрын
Resolve Git Stash Merge Conflicts
6:17
Git Cherry Pick Tutorial
4:42
Жыл бұрын
Basic TMUX tutorial & cheatsheet
4:22
macOS vs Windows for Programming
4:56
My NYC coding setup
4:56
5 жыл бұрын
Пікірлер
@user-lk1md5mn1i
@user-lk1md5mn1i 6 сағат бұрын
not useful
@alens8265
@alens8265 Күн бұрын
Syncing repos was a nightmare for me. Not anymore! Thanks A lot!!!
@user-eq4zl8mq7k
@user-eq4zl8mq7k Күн бұрын
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
@siddharthnayak4448
@siddharthnayak4448 2 күн бұрын
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_
@Brxndz_ 3 күн бұрын
This was awesome! Online can make rebase look so terrifying
@AkimboFennec
@AkimboFennec 3 күн бұрын
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 KZbin 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.
@themoderncoder
@themoderncoder 2 күн бұрын
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.
@mariocalderon2148
@mariocalderon2148 4 күн бұрын
Thank you, amazing! I was always "afraid" of using cherry picking, but with this excellent explanation I will use it often.
@Confusedcapybara8772
@Confusedcapybara8772 5 күн бұрын
Great video. Would love to see how this plays with pull requests
@themoderncoder
@themoderncoder 4 күн бұрын
True. My next few videos will be on Git collaboration and I think PRs could fit nicely into that series
@kirank3368
@kirank3368 5 күн бұрын
This is insane ❤
@joaomendoncayt
@joaomendoncayt 6 күн бұрын
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.
@themoderncoder
@themoderncoder 4 күн бұрын
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.
@mariocalderon2148
@mariocalderon2148 7 күн бұрын
Thanks a lot! At last after several years using Git, I (think) I finally grasped it.
@celikvolkan
@celikvolkan 7 күн бұрын
Best explanation I have ever seen on KZbin about merge vs rebase. Thank you for sharing.😺
@budivoogt491
@budivoogt491 8 күн бұрын
Great video, thanks for the effort.
@abcdabcd8605
@abcdabcd8605 9 күн бұрын
Amazing explanation. Those animations made it very easy to understand.
@majorgear1021
@majorgear1021 9 күн бұрын
Not bad . Does it change if you cannot push to master but instead have to do a pull request? We have branch protection enabled at work , so changes require PR’s that have to pass automated tests and also get at least 2 approvals.
@themoderncoder
@themoderncoder 8 күн бұрын
It depends on exactly how your main branch authorization scheme works, but most PRs will allow you to specify how approved changes should be integrated. I know GitHub PRs allow you to select either merge, rebase or squash+rebase
@robwalker4653
@robwalker4653 9 күн бұрын
I quite like a semi linear approach. If I have a release/feature branch that multiple people are working on, rebase to keep in linear. Then when then when you want to merge to master, do a rebase and then merge with no fast forward. This way if you use gitversion, your main branch only has one commit per release but you have full history of commits for each release without a bird nest.
@AnantaAkash.Podder
@AnantaAkash.Podder 9 күн бұрын
Excellent Explanation... Thank You
@gentjanshtjefni4368
@gentjanshtjefni4368 10 күн бұрын
can i pop the stash on another branch?
@themoderncoder
@themoderncoder 2 күн бұрын
Yeah go for it. Stash on one branch, switch branches, then pop/apply the stash. Should work fine
@ejovo
@ejovo 10 күн бұрын
Awesome video man.
@megharajdeepak
@megharajdeepak 11 күн бұрын
Not sure if I am doing it right. I have 2 branches, dev and main. Let's say dev and main are in sync initially. At at present, my development work in going on and I have added 3 new commits to dev (main now lags by 3 commits). At this point of time there is a production issue and I add a fix on dev and make the 4th commit. After switching to main branch, if I run `git cherry-pick bd46315 <4th-commit-hash>`, it's pulling earlier 3 commits along with 4th one. I want to pull only the 4th commit: bd46315 (origin/dev, dev) 4.HOT FIX ADDED ede1f33 3.textarea added 88cdb80 2. select dd added c93667f 1. text input added 62d132f (HEAD -> main, origin/main) Initial commit
@orangekanso
@orangekanso 12 күн бұрын
Your teaching approach is refreshingly efficient and straightforward, guiding learners directly towards their goals. The use of animation enhances comprehension and fosters a deeper understanding of all the concepts related to Git. many thanks
@Arthur-cx1cg
@Arthur-cx1cg 12 күн бұрын
First time when someone could really explain something in sub 10 minutes.
@knightcodes7681
@knightcodes7681 14 күн бұрын
This video is fantastic. Thanks for sharing
@shawnzhang528
@shawnzhang528 16 күн бұрын
After I did rebase, the order of commits changed...
@knecks7374
@knecks7374 17 күн бұрын
Absolutely Awesome Big man! thanks
@adityakumarseth8934
@adityakumarseth8934 18 күн бұрын
how is git fetch different from git pull ?
@themoderncoder
@themoderncoder 18 күн бұрын
Fetch simply downloads the changes but doesn’t merge them. Pull is a combination of fetch and merge under the hood, so it downloads AND merges at the same time.
@adityakumarseth8934
@adityakumarseth8934 18 күн бұрын
Really Good Video
@ic_1234
@ic_1234 18 күн бұрын
very nice, sir, thanks!!!
@NicholasShanks
@NicholasShanks 18 күн бұрын
1:04: "And that maximises the pain" - I feel it bro.
@themoderncoder
@themoderncoder 18 күн бұрын
lol
@daveanvs
@daveanvs 20 күн бұрын
Excellent work, thank for helping me understand several Git concepts
@jacakopl
@jacakopl 20 күн бұрын
Nice but too abstract 😢
@TheSpeechkiss
@TheSpeechkiss 21 күн бұрын
I'm a bit confused. In the first example, you did this: 1. touch config.json 2. git add . 3 git commit -m "Added configuration file skeleton" 4. git fetch origin 5. git push origin main git fetch origin - "reaches out to remote repository and pulls down any new commits that you might not have yet" . However in the second example(coffee break) you did this : 1. git fetch origin # automatically downloads the changes 2. git status # your branch is 1 commit behind 3. git merge origin/main # to incorporate those changes into your local branch - to merge your local main with origin main. 4. git status # Voilà ! I don't fully understand why did you do "git merge origin/main" in the 2nd example. In the first example just "git fetch origin" was enough to download any changes and then do a push.
@themoderncoder
@themoderncoder 21 күн бұрын
In the first example the origin repository doesn't have any new changes, so you could actually run "git merge origin/main" after "git fetch origin" in the first example, but nothing would happen. I was trying to keep the example as simple as possible which is why I skipped the merge in the first example; however, there is no harm in running merge after every fetch. If there is nothing, then the merge will just output "Already up to date."
@lookingforbino
@lookingforbino 22 күн бұрын
Great tutorial. Thanks My question: Context: one of the weekends, I made tons of progress for the codebase, I changed 10 files. Let's say I am only allowed to make a PR that includes changes from 2 files. I don't want to make PRs during the weekends, and I am going to make 5 prs on Monday, and they all depend on each other, meaning I need to divide all my progress into at least 5 PRs. Question: What is your git stratagy to handle this situation?
@themoderncoder
@themoderncoder 21 күн бұрын
You'd probably need to do something like this (newsletter.pragmaticengineer.com/p/stacked-diffs); however, limiting PRs to only 2 files doesn't really make sense. If all the code changes are related to a single feature they shouldn't be split up. At the very least, I'd suggest grouping the files together based on functionality, but if one PR depends on another to function, they should probably be in the same PR.
@MrVipulLal
@MrVipulLal 22 күн бұрын
Hi. Have fun!
@MrVipulLal
@MrVipulLal 23 күн бұрын
Disagree… I use WSL extensively
@MrVipulLal
@MrVipulLal 23 күн бұрын
Great video. Thanks. What software fif you use to animate?
@themoderncoder
@themoderncoder 22 күн бұрын
I use Final Cut Pro and Apple Motion
@lookingforbino
@lookingforbino 23 күн бұрын
Thanks for the tutorial. A question: I ran into a problem of headless state after I checked out a specific commit inside the branch to make a pr on top of the specific commit. My manager told me don't checkout commit, alway checkout branch. I just don't understand this, what's the thing with headless state, and why it's a bad practice to checkout a commit?
@themoderncoder
@themoderncoder 21 күн бұрын
It's just that you'll have a harder time merging changes made in a headless state. Branches are really the core of Git, and a lot of mechanisms (merging, push, pull fetch, PRs) are based on branches/commits that build off of each-other in a predicable way. As soon as you check out a commit and enter a headless state, you're operating outside of a well established hierarchy of commits/branches. This means the changes you make can be easily lost, and it's harder to reconcile things afterwards. I'd view checking out a commit as a rare operation. If I understand your situation correctly: if you really need to make changes off of a specific commit maybe creating a new branch and cherry picking the commit into that branch might be easier.
@harikrishnan9967
@harikrishnan9967 24 күн бұрын
Hi bro i have one issue while cherry pick what is happening na example my bug fix is in fix1 branch which dev branch and i need to movie that in production branch so when i moved this thing in that prod branch it error while im compiling because of in prod old code is there and dev every person doing new changes are there my cherry pick changes are moved to some other lines so help me to resolve this bro
@themoderncoder
@themoderncoder 24 күн бұрын
I'm not 100% sure I understood your question, but a suggestion would be to rebase your "fix1" branch against production BEFORE cherry picking. This would at least minimize the amount of conflicting changes.
@harikrishnan9967
@harikrishnan9967 23 күн бұрын
@@themoderncoder im not talking about conflict, after resolving the conflict while I'm compile it is showing some errors because of cherry pick is stored in wrong lines in files
@Luis-xe9og
@Luis-xe9og 25 күн бұрын
I spent the lat 24 hrs trying to figure out how the whole process of rebase was and how it works. Now with your video makes total clear
@AkinBelieve
@AkinBelieve 26 күн бұрын
Excellent. Very few can deliver technical information with this sort of precision. Please, please, please keep these coming.
@themoderncoder
@themoderncoder 25 күн бұрын
Appreciate the compliment! These vids end up taking a ton of time to make, but I’m committed to keeping them going at least once a month. Hopefully I can find a rhythm for 2 a month, but we’ll see…
@alexanderagruso4576
@alexanderagruso4576 26 күн бұрын
Git of the building blocks???
@themoderncoder
@themoderncoder 26 күн бұрын
lol yeah it’s not the most readable, but it looks so cool!?
@1sam2fisher
@1sam2fisher 27 күн бұрын
I gotta say, till this day you have some of the most if not the most appealing, understandable and engaging videos about learning git in all YT. I really need to support you, where I have the chance I'm gonna buy the course. P.D: I don't know about marketing but I feel that with the proper approach, your course will definitely "sell out".
@themoderncoder
@themoderncoder 27 күн бұрын
To be honest it’s been a lot to juggle everything. Finding that balance of getting the word out about LearnGit.io but not feeling too “salesy” has been tough. Really appreciate your comment, and motivation to keep pushing.
@Braven36
@Braven36 28 күн бұрын
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 24 күн бұрын
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 18 күн бұрын
@@themoderncoder Thanks
@RichFinelli
@RichFinelli 28 күн бұрын
At the end when you demo'd multiple commits being cherry picked, the more recent commit was listed first. If the recent commit built on top of the earlier commit, would it make sense to order them by earlier commit first and recent commit second when doing git cherry pick? I.e. git cherry-pick <earlier-commit> <recent-commit>
@themoderncoder
@themoderncoder 24 күн бұрын
Yes! If you're picking multiple I'd keep the same order as they originally were. Sorry - I didn't realize I did them out of order in the video. Good catch.
@slavvycoelho2367
@slavvycoelho2367 29 күн бұрын
what happens to the feature branch when you rebase it on master?
@themoderncoder
@themoderncoder 24 күн бұрын
Nothing happens to the feature branch - it still points to the latest commit. The only difference is that the main branch now points to that commit as well. In the example below both the "main" branch pointer and the "feature" branch pointer reference d` BEFORE REBASE a --> b --> c (main) \__ d (feature) AFTER REBASE a --> b --> c --> d` (main, feature)
@nishikantwairkar6866
@nishikantwairkar6866 29 күн бұрын
too good
@computerscience8389
@computerscience8389 29 күн бұрын
I’m really thankful for you having produced this material on git rebase. Thank you. Also, I really appreciate the write-up as well. Great contribution. Subscribed.
@mjakaria-ruet
@mjakaria-ruet Ай бұрын
As of now, I have seen a few videos about rebase but it is very compact. Thanks