Philomatics
Philomatics
  • 8
  • 418 007
Filter, Map, Reduce from first principles
Most developers have used filter, map and reduce at least once, but do you actually know what's going on under the hood?
If you like my style of teaching, I'd love to see you at my intermediate git workshop!
philomatics.com/git-workshop/
All code from this video:
philomatics.com/filter-map-reduce-code/
My other video on git rebase
czcams.com/video/DkWDHzmMvyg/video.html
Fixing merge conflicts:
czcams.com/video/DloR0BOGNU0/video.html
Video on `git pull --rebase`:
czcams.com/video/xN1-2p06Urc/video.html
How to change your default editor in git:
czcams.com/video/CAnQ4b0uais/video.html
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/items?itemName=mhutchie.git-graph
If you don't use VSCode, you can also use SourceTree, which is free.
www.sourcetreeapp.com/
0:00 - Why filter, map, reduce?
1:23 - Higher-Order Functions
4:22 - Building up filter from scratch
7:17 - Map
8:28 - Reduce
12:00 - git cheatsheet
Thank you to 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).
zhlédnutí: 2 457

Video

git interactive rebase - Undo, Edit & Squash git commits with a single command
zhlédnutí 3,1KPřed dnem
git rebase interactive lets you undo, edit, squash and delete commits. If you like my style of teaching, I'd love to see you at a workshop! philomatics.com/git-workshop/ My other video on git rebase czcams.com/video/DkWDHzmMvyg/video.html Fixing merge conflicts: czcams.com/video/DloR0BOGNU0/video.html Video on `git pull rebase`: czcams.com/video/xN1-2p06Urc/video.html How to change your default...
git rebase - Why, When & How to fix conflicts
zhlédnutí 30KPřed 14 dny
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: czcams.com/video/DloR0BOGNU0/video.html Video on `git pull rebase`: czcams.com/video/xN1-2p06Urc/video.html How to change your default editor in git: czcams.com/video/CAnQ4b0uais/video.html Us...
Spend more money on developer tools and hardware
zhlédnutí 4,4KPřed 21 dnem
How to get your manager to pay for developer tools, hardware and infrastructure like AWS/Vercel. 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. ...
Never fear merge conflicts again - git merge/pull tutorial
zhlédnutí 14KPřed měsícem
What I wish I had known when I started using git. 0:00 - Aborting the merge 0:26 - Understanding conflict markers 1:30 - Automatic merge options 2:38 - Doing a manual merge 3:36 - Understanding complex conflicts 4:09 - Adding the resolved files 4:32 - Completing the merge LEGAL DISCLAIMER ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ Everything here is for informational purposes only. All non-licensed clips used ...
Use past tense in git commit messages
zhlédnutí 13KPřed měsícem
Should you be using past or present tense in your git commit messages? StackOverflow answer arguing in favor of past tense: stackoverflow.com/a/8059167/196540 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...
10 useful git aliases
zhlédnutí 11KPřed měsícem
Learn how to use git much faster with useful shortcuts. 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. After that you can use the following command to open the global config: git config global edit There, you can paste the comm...
Never* use git pull
zhlédnutí 339KPřed měsícem
How to use git pull rebase to keep your team's commit history clean. Command for creating the 'git pr' alias (so you can copy-paste): git config global alias.pr "pull rebase" Thank you to Bruno Paulino, Ben Freundorfer, and Jonas Geiler for reviewing drafts of this video and their feedback! Video Contents: 0:00 - Never use git pull 0:43 - Why not git pull? 1:40 - Using git pull rebase 2:11 - De...

Komentáře

  • @andreh.9300
    @andreh.9300 Před 10 hodinami

    I use rebase quite often, but not so much with the interactive option. Great walkthrough, thank you! 🙌🏾

  • @Shulkerkiste
    @Shulkerkiste Před 17 hodinami

    Very good video :)

  • @SuperMilhauz
    @SuperMilhauz Před 22 hodinami

    Thank you, this helped me a lot.

  • @pravinprince3221
    @pravinprince3221 Před 2 dny

    Thank you for the wonderful video sir it was so useful for me and my team, thanks again

    • @philomatics
      @philomatics Před dnem

      Thanks for the nice comment and sharing the video with your team, made my day :)

  • @SuffyanAsad
    @SuffyanAsad Před 2 dny

    I first got to learn these concepts when starting with big data, and again when starting to learn Spark. I wish someone had explained them to me this well back then!

  • @ytfeelslikenorthkorea

    woow... that was useful. Thanks!

  • @thedamned87
    @thedamned87 Před 3 dny

    Thanks a lot for all your work. Especially this video helped me with my work the last few days a lot and how to "correctly" use git rebase!

  • @Daijyobanai
    @Daijyobanai Před 3 dny

    @2.08 information I have been looking for for literally years. Thanks, all the "use rebase!" guys I have worked with never once managed to explain why!

  • @aaaaaaaaaaaaaaaaaaaaaaaaaaaab1

    very easy to sift through merge commits. a normal gui will hide them for you. Don't waste your CPU on overthinking git. The simple rule is always merge. Never rebase, never squash.

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

    Can you make a video about classes/oop

    • @philomatics
      @philomatics Před 3 dny

      Hey, thanks for the suggestion! That's a pretty broad topic, do you have anything specific you'd like me to focus on? Like a specific question or situation?

    • @christinaphan5124
      @christinaphan5124 Před dnem

      @@philomaticsA OOP video would be pretty neat! I find it a bit hard to apply OOP concepts into code when I’m not explicitly given the specs (e.g., academic assignments). It would be cool to see how I should be framing my thought process to get more into an OOP mindset, if that makes sense

  • @vtv4373
    @vtv4373 Před 4 dny

    You can set the default behavior of git pull to --rebase by doing git config --global pull.rebase true

  • @pippinproductions
    @pippinproductions Před 4 dny

    I would use something like this but its slower and often harder to read than loops (when it gets complex)

  • @waltert9
    @waltert9 Před 4 dny

    awesome vid

  • @edgararrizon5736
    @edgararrizon5736 Před 4 dny

    another banger, didnt even know i wanted this

  • @dodo22r
    @dodo22r Před 4 dny

    great content, just started with coding, it s deffo not for beginners, or its just me , i will learn and then get back to this video. Keep it up!!

    • @philomatics
      @philomatics Před 4 dny

      Great attitude! Would love to hear if you feel like I could've explained something better or if it got confusing for you anywhere in the video :)

  • @kezzyhko
    @kezzyhko Před 4 dny

    I don't know about other languages, but in C#'s LINQ, there is more to that. With the code provided in the video, each element is processed immediately when using .map(). In C#, you can use .map(...).first(...), and only the first element will be processed by .map()'s function. Similarly, if you assign processed array.map(...).filter(...) to a variable, it will return IEnumerable, and callbacks passed to .map() and .filter() will be executed only when you enumerate it (for example, use .first() or foreach on said variable)

    • @philomatics
      @philomatics Před 4 dny

      Right! I don't know much C#, but in Java's stream API it's the same - most of the time, only those elements are iterated that are actually needed. So it definitely depends on the language how much the performance is impacted.

    • @kezzyhko
      @kezzyhko Před 4 dny

      Ah yes, commenting before watching to the end, as always. Still not gonna delete the comment lol

    • @philomatics
      @philomatics Před 4 dny

      No worries :)

    • @masterflitzer
      @masterflitzer Před 4 dny

      these are just implementation details

    • @kezzyhko
      @kezzyhko Před 4 dny

      @@masterflitzer implementation details, which are still important to know. If one of these callback functions take a long time to execute, you don't want to call it twice. And if you use foreach multiple times on the same variable - result is defferent for different implementations. Also, it's a cool fact anyway :)

  • @DerSolinski
    @DerSolinski Před 4 dny

    11:34 Ha, good one haven't seen that one yet.

  • @dipanshusabharwal
    @dipanshusabharwal Před 4 dny

    Great explanation

  • @darwinmanalo5436
    @darwinmanalo5436 Před 4 dny

    Good visualization

  • @WHAT-GRINDS-MY-GEARS

    Nice, variable are in like everything. Love it.

  • @tanujkanti1088
    @tanujkanti1088 Před 4 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 4 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 4 dny

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

    • @tanujkanti1088
      @tanujkanti1088 Před 4 dny

      Thanks I'll try that

  • @rascta
    @rascta Před 5 dny

    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 4 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

  • @LifeIsCrazyAsShit
    @LifeIsCrazyAsShit Před 5 dny

    Nice

  • @bswck
    @bswck Před 5 dny

    ...or maybe just configure git pull command to by default use rebase strategy?

    • @philomatics
      @philomatics Před 5 dny

      Good point! I added this to the pinned comment :)

  • @SimoneCattaneodango

    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 5 dny

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

    • @SimoneCattaneodango
      @SimoneCattaneodango Před 4 dny

      @@philomatics got it, thank you so much 😀

  • @ProfRoxas
    @ProfRoxas Před 7 dny

    i like how vs code simplifies this with the sync button that will pull then push the local changes automatically without the user seeing it actually created a merge in the background then i see the commits by my coworkers and know they forgot to pull i always pull first, ifit fails (i'm behind) i either undo my local commit then pull and redo mine, or rebase (which i usually dont need to), but i too avoid this unnecessary merge commits, i hate those too

  • @FransOilinki
    @FransOilinki Před 7 dny

    The command `git pull --rebase` running without errors is no guarantee there are no problems. Rebase works on plain text files without semantic understanding of them, so there still could be problems stemming from functionally conflicting commit mismatches. As an example, suppose you call a function somewhere in your rebased commits that is removed by the fetched commits. This is a nice example because it visibly breaks the code, but it could be less subtle. If you like to use `git pull --rebase` (which definitively is better than `git pull`) you should still spend a few seconds to check there are no functional conflicts.

    • @philomatics
      @philomatics Před 5 dny

      Good point, fully agree! Though I wonder, wouldn't that happen regardless of whether you merge or rebase?

  • @derekchan1570
    @derekchan1570 Před 7 dny

    In most cases you will be working on different branches/PR and the main branch is usually locked from direct push. When finishing the PR most hosts offer "squash merge" that no matter how many commits in your PR, there will be one commit in master after merging.

  • @user-yz2mv8kn4x
    @user-yz2mv8kn4x Před 8 dny

    amazing video explaining git concepts :) really helped me visualise and understand better. thank you so much

    • @user-yz2mv8kn4x
      @user-yz2mv8kn4x Před 7 dny

      subscribed and looking forward to more of your videos!

    • @philomatics
      @philomatics Před 5 dny

      Thank you for your very nice comment! More stuff on my channel :)

  • @alexanderkonstantinov6859

    Why not git stash, git pull, git stash pop?

    • @philomatics
      @philomatics Před 5 dny

      Good question :) Git stash will not help in this case, because it will only stash uncommitted changes, but here you've already made fresh commits on your branch.

  • @aram5642
    @aram5642 Před 8 dny

    What is the right syntax if I am not trying to push to a shared branch, but I am just updating my feature branch before submitting for a code review? Do I git pull --rebase origin/master?

  • @muhammadfahad3483
    @muhammadfahad3483 Před 8 dny

    So what is difference between git pull --rebase and git rebase <branch>?

  • @hollow_ego
    @hollow_ego Před 9 dny

    Another interesting topic would be patches. What do they do? Why are they useful? How do they differ to cherry picking? Pros? Cons?

    • @philomatics
      @philomatics Před 8 dny

      Thanks for the suggestion! Will consider it!

  • @MiMi-dg4de
    @MiMi-dg4de Před 9 dny

    never rebase pushed commits! So what to do with pushed ones? git merge?

    • @philomatics
      @philomatics Před 8 dny

      Well, if you are 100% sure no one else is working on the branch, and nobody else has checked it out locally, you can still rebase. Otherwise you gotta coordinate with your team to make sure no work is lost. One way to do this is to make sure one person has all the latest changes on that specific branch, and then asking that person to do the rebase. From that point on nobody else is allowed to modify that branch anymore, and ideally the branch should be merged and deleted after the final rebase. I generally don't recommend rebasing shared branches though.

  • @yashwanthsrivathsavakurapa2511

    I literally chat GPT'd for this and found out about the interactive base, but I didn't do it because it looked complex. Your video explained it pretty well ❤ Also, I'd love that video on removing wrongly committed sensitive information. Thankss soo mucchh

  • @ghun131
    @ghun131 Před 10 dny

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

  • @tswdev
    @tswdev Před 10 dny

    Just do "git config --global pull.rebase true" to change the default behavior. You can also use git pull --ff-only which will fail if you cant easily pull the remote changes Edit: i guess I should have read the pinned comment hum?

  • @jinx.love.you.
    @jinx.love.you. Před 10 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...

  • @RonnieDenzel
    @RonnieDenzel Před 10 dny

    The master of git back at it again😅

  • @RonnieDenzel
    @RonnieDenzel Před 10 dny

    Just saw this in my feed and subscribed,my guy came out of nowhere cooking git💯

  • @benjaminlehmann
    @benjaminlehmann Před 11 dny

    Great video. Really helpful. Thanks

  • @Zx-jp7cn
    @Zx-jp7cn Před 11 dny

    wake up babe, new Philomatics video just dropped

  • @shis10
    @shis10 Před 11 dny

    Cheat sheet would be amazing. Waiting for it. 🙌🏻

  • @MrVanshajSaxena
    @MrVanshajSaxena Před 11 dny

    Subscribed, thank you.

  • @BlackDroid003
    @BlackDroid003 Před 11 dny

    a tip from experience: if you have a huge repo, "make a copy" to "backup before a rebase" is not always feasible. you could instead make a copy of your current branch (the one you're trying to rebase, ie 'feature/login') by just branching off of that (eg to 'feature/login_backup'). this would keep all the relevant "original" commits, As a branch stores references to commits (and does no copy of actual data), this should be very fast. Then if your rebase completely falls apart or you are not happy, checkout the 'feature/login_backup', delete the (broken) 'feature/login' branch, and branch 'feature/login_backup' again to 'feature/login' (ie like the above, but swapped, if that makes sense). This "restoring with a copy-branch" is then also reasonably fast, depending on what you changed in the rebase. This avoids large copies, and you don't have to touch the '.git' directory (if you had the idea to "just copy that and the few files"). I mean, "if it works, it works", but i would not touch the .git dir at all Also some more shortcuts: the 'fixup' command in the rebase is like 'squash' but it always keeps the first commits message (without asking! so make sure, its the correct order). Useful, when you are "done", but want to make small corrections outside a active rebase (eg, when you need all commits for some compiled language or whatever). So at the end you just need to "reorder and squash" all of that - and when you have a lot of those tiny commits, fixup is faster and less annoying that squash, since that opens the edit-message-file every time. 'break' may also be useful in specific cases. it's like 'edit' but doesn't need a commit. like instead of 'edit' one commit, you 'pick' that and put an empty 'break' after it. this is relevant, when you want to insert something new at the very start (when you don't have a commit to re-order) Very specific, but perhaps for someone easier to understand (as the order is more explicit)?

    • @philomatics
      @philomatics Před 11 dny

      These are some really cool tips, thanks for sharing!

    • @khald0r
      @khald0r Před 9 dny

      Very helpful. Thanks for sharing

  • @lokith.s5502
    @lokith.s5502 Před 11 dny

    This was so helpful thanks :) I need video on atomic commit and removing sensitive info from commit

  • @saketkr
    @saketkr Před 11 dny

    this was so helpful!

  • @tobiasj8019
    @tobiasj8019 Před 11 dny

    nice, could you explain git rebase --onto? Instead of creating a backup folder you can just use the reflog. and again a nice video! keep it up. I recommend your videos to all my colleagues

    • @philomatics
      @philomatics Před 11 dny

      Thank you so much! And thanks for the suggestion too! Will think about it :) Seems a bit too little for a whole video but maybe a short. Haven't tried those yet.

    • @TokyoXtreme
      @TokyoXtreme Před 10 dny

      @@philomaticsisn't --onto just for doing a rebase without checking out the branch first?

    • @tobiasj8019
      @tobiasj8019 Před 6 dny

      @@TokyoXtreme no, you can explicity define the commit where u want to start with / use with

    • @TokyoXtreme
      @TokyoXtreme Před 6 dny

      @@tobiasj8019 Time for me to go back to the manual I guess 🤓

    • @tobiasj8019
      @tobiasj8019 Před 6 dny

      @@TokyoXtreme 😉

  • @crossscar-dev
    @crossscar-dev Před 11 dny

    what if vim is actually my main editor? (P.S. I use arch btw)

    • @philomatics
      @philomatics Před 11 dny

      Real hackers write their own editor

    • @crossscar-dev
      @crossscar-dev Před 11 dny

      @@philomatics who said I wasn't writing an os: github.com/CommanderGL/csos-limine

    • @sanjeevsinghrajput5593
      @sanjeevsinghrajput5593 Před 11 dny

      git log --oneline --graph might be the closest you can get ig?

  • @quintenpreiss7692
    @quintenpreiss7692 Před 11 dny

    Those memes are funny